Merge pull request #59 from remcohaszing/simplify-webpack-example-structures

Use a more minimal webpack config for examples
This commit is contained in:
Remco Haszing 2021-07-18 13:35:58 +02:00 committed by GitHub
commit ce58d4b6d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 6 additions and 39 deletions

3
.gitignore vendored
View file

@ -1,4 +1,5 @@
/node_modules/ dist/
node_modules/
/out/ /out/
/lib/ /lib/
*.log *.log

View file

@ -1,2 +0,0 @@
dist/
node_modules/

View file

@ -1,4 +1,4 @@
# Demo: Weback + Worker Loader + Monaco + Monaco YAML # Usage example with Webpack and worker-loader
To run: To run:

View file

@ -1,16 +1,6 @@
const { resolve } = require('path');
const HtmlWebPackPlugin = require('html-webpack-plugin'); const HtmlWebPackPlugin = require('html-webpack-plugin');
module.exports = { module.exports = {
entry: {
main: './index.js',
},
output: {
globalObject: 'this',
filename: '[name].bundle.js',
path: resolve(__dirname, 'dist'),
},
module: { module: {
rules: [ rules: [
{ {
@ -23,13 +13,5 @@ module.exports = {
}, },
], ],
}, },
plugins: [ plugins: [new HtmlWebPackPlugin()],
new HtmlWebPackPlugin({
template: './index.html',
}),
],
node: {
fs: 'empty',
module: 'empty',
},
}; };

View file

@ -1,2 +0,0 @@
dist/
node_modules/

View file

@ -1,17 +1,13 @@
const { resolve } = require('path');
const HtmlWebPackPlugin = require('html-webpack-plugin'); const HtmlWebPackPlugin = require('html-webpack-plugin');
module.exports = { module.exports = {
entry: { entry: {
main: './index.js', main: './src/index.js',
'editor.worker': 'monaco-editor/esm/vs/editor/editor.worker.js', 'editor.worker': 'monaco-editor/esm/vs/editor/editor.worker.js',
'yaml.worker': 'monaco-yaml/lib/esm/yaml.worker.js', 'yaml.worker': 'monaco-yaml/lib/esm/yaml.worker.js',
}, },
output: { output: {
globalObject: 'this',
filename: '[name].bundle.js', filename: '[name].bundle.js',
path: resolve(__dirname, 'dist'),
}, },
module: { module: {
rules: [ rules: [
@ -25,13 +21,5 @@ module.exports = {
}, },
], ],
}, },
plugins: [ plugins: [new HtmlWebPackPlugin()],
new HtmlWebPackPlugin({
template: './index.html',
}),
],
node: {
fs: 'empty',
module: 'empty',
},
}; };