mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 20:52: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:
|
To run this sample, you need to:
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
$/browser-esm-webpack-monaco-plugin> npm install
|
$/browser-esm-webpack> npm install .
|
||||||
$/browser-esm-webpack-monaco-plugin> npm run start
|
$/browser-esm-webpack> ./node_modules/.bin/webpack
|
||||||
|
|
||||||
# or to build for production
|
|
||||||
$/browser-esm-webpack-monaco-plugin> npm run build
|
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
If you're building for production you need to statically serve the files:
|
Then, <a href="./dist">open the ./dist folder</a>.
|
||||||
|
|
||||||
<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>
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import * as monaco from "monaco-editor";
|
import * as monaco from "monaco-editor/esm/vs/editor/editor.api";
|
||||||
|
|
||||||
(function () {
|
(function () {
|
||||||
// create div to avoid needing a HtmlWebpackPlugin template
|
// 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,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"start": "webpack-dev-server --progress --mode development",
|
"build": "webpack --progress"
|
||||||
"build": "webpack --progress --mode production"
|
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"css-loader": "^2.1.1",
|
"css-loader": "^3.2.0",
|
||||||
"file-loader": "^3.0.1",
|
"file-loader": "^4.2.0",
|
||||||
"html-webpack-plugin": "^3.2.0",
|
|
||||||
"monaco-editor-webpack-plugin": "^1.7.0",
|
"monaco-editor-webpack-plugin": "^1.7.0",
|
||||||
"style-loader": "^0.23.1",
|
"style-loader": "^1.0.0",
|
||||||
"webpack": "^4.32.0",
|
"webpack": "^4.39.2",
|
||||||
"webpack-cli": "^3.3.2",
|
"webpack-cli": "^3.3.6"
|
||||||
"webpack-dev-server": "^3.4.1"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"monaco-editor": "^0.16.2"
|
"monaco-editor": "^0.16.2"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin");
|
const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin");
|
||||||
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
mode: process.env.NODE_ENV,
|
mode: process.env.NODE_ENV,
|
||||||
|
|
@ -10,34 +9,14 @@ module.exports = {
|
||||||
filename: "[name].bundle.js",
|
filename: "[name].bundle.js",
|
||||||
},
|
},
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [{
|
||||||
{
|
|
||||||
test: /\.css$/,
|
test: /\.css$/,
|
||||||
use: [
|
use: ["style-loader", "css-loader",],
|
||||||
"style-loader",
|
}],
|
||||||
"css-loader",
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: /\.(png|jpg|gif|svg|woff2?|ttf|eot|otf)$/,
|
|
||||||
use: [
|
|
||||||
{
|
|
||||||
loader: "file-loader",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new MonacoWebpackPlugin({
|
new MonacoWebpackPlugin({
|
||||||
languages: ["typescript", "javascript", "css"],
|
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