mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 19:42:56 +01:00
Simplify sample, update npm deps to remove npm security errors
This commit is contained in:
parent
27b10e31fa
commit
c79ea537b5
7 changed files with 373 additions and 2383 deletions
1
browser-esm-webpack-monaco-plugin/.gitignore
vendored
Normal file
1
browser-esm-webpack-monaco-plugin/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
dist/*.js
|
||||
12
browser-esm-webpack-monaco-plugin/dist/index.html
vendored
Normal file
12
browser-esm-webpack-monaco-plugin/dist/index.html
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script src="./main.bundle.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -11,20 +11,11 @@
|
|||
To run this sample, you need to:
|
||||
|
||||
<pre>
|
||||
$/browser-esm-webpack-monaco-plugin> npm install
|
||||
$/browser-esm-webpack-monaco-plugin> npm run start
|
||||
|
||||
# or to build for production
|
||||
$/browser-esm-webpack-monaco-plugin> npm run build
|
||||
$/browser-esm-webpack> npm install .
|
||||
$/browser-esm-webpack> ./node_modules/.bin/webpack
|
||||
</pre>
|
||||
|
||||
If you're building for production you need to statically serve the files:
|
||||
|
||||
<pre>
|
||||
$/browser-esm-webpack-monaco-plugin> npm run build
|
||||
$/browser-esm-webpack-monaco-plugin> cd dist
|
||||
$/browser-esm-webpack-monaco-plugin/dist> npx static-server -p 3000 -o
|
||||
</pre>
|
||||
Then, <a href="./dist">open the ./dist folder</a>.
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import * as monaco from "monaco-editor";
|
||||
import * as monaco from "monaco-editor/esm/vs/editor/editor.api";
|
||||
|
||||
(function () {
|
||||
// create div to avoid needing a HtmlWebpackPlugin template
|
||||
|
|
|
|||
2661
browser-esm-webpack-monaco-plugin/package-lock.json
generated
2661
browser-esm-webpack-monaco-plugin/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -6,21 +6,17 @@
|
|||
"private": true,
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"start": "webpack-dev-server --progress --mode development",
|
||||
"build": "webpack --progress --mode production"
|
||||
"build": "webpack --progress"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"css-loader": "^2.1.1",
|
||||
"file-loader": "^3.0.1",
|
||||
"html-webpack-plugin": "^3.2.0",
|
||||
"css-loader": "^3.2.0",
|
||||
"file-loader": "^4.2.0",
|
||||
"monaco-editor-webpack-plugin": "^1.7.0",
|
||||
"style-loader": "^0.23.1",
|
||||
"webpack": "^4.32.0",
|
||||
"webpack-cli": "^3.3.2",
|
||||
"webpack-dev-server": "^3.4.1"
|
||||
"style-loader": "^1.0.0",
|
||||
"webpack": "^4.39.2",
|
||||
"webpack-cli": "^3.3.6"
|
||||
},
|
||||
"dependencies": {
|
||||
"monaco-editor": "^0.16.2"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
const path = require("path");
|
||||
const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin");
|
||||
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
||||
|
||||
module.exports = {
|
||||
mode: process.env.NODE_ENV,
|
||||
|
|
@ -10,34 +9,14 @@ module.exports = {
|
|||
filename: "[name].bundle.js",
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
rules: [{
|
||||
test: /\.css$/,
|
||||
use: [
|
||||
"style-loader",
|
||||
"css-loader",
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpg|gif|svg|woff2?|ttf|eot|otf)$/,
|
||||
use: [
|
||||
{
|
||||
loader: "file-loader",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
use: ["style-loader", "css-loader",],
|
||||
}],
|
||||
},
|
||||
plugins: [
|
||||
new MonacoWebpackPlugin({
|
||||
languages: ["typescript", "javascript", "css"],
|
||||
}),
|
||||
new HtmlWebpackPlugin()
|
||||
],
|
||||
devServer: {
|
||||
port: 4000,
|
||||
hot: process.env.NODE_ENV === 'development',
|
||||
open: true
|
||||
},
|
||||
devtool: process.argv.includes("--use-sourcemaps") ? "inline-source-map" : false,
|
||||
})
|
||||
]
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue