monaco-editor/monaco-editor-samples/browser-esm-webpack-small/webpack.config.js

36 lines
848 B
JavaScript
Raw Normal View History

2018-03-15 00:00:41 +08:00
const path = require('path');
const TerserPlugin = require('terser-webpack-plugin');
2018-03-15 00:00:41 +08:00
module.exports = {
mode: 'production',
entry: {
2020-09-02 23:35:10 +08:00
app: './index.js',
'editor.worker': 'monaco-editor/esm/vs/editor/editor.worker.js'
2018-03-15 00:00:41 +08:00
// "json.worker": 'monaco-editor/esm/vs/language/json/json.worker',
// "css.worker": 'monaco-editor/esm/vs/language/css/css.worker',
// "html.worker": 'monaco-editor/esm/vs/language/html/html.worker',
// "ts.worker": 'monaco-editor/esm/vs/language/typescript/ts.worker',
},
output: {
globalObject: 'self',
2018-03-15 00:00:41 +08:00
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'dist')
},
module: {
2020-09-02 23:35:10 +08:00
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.ttf$/,
use: ['file-loader']
}
]
2018-03-15 00:00:41 +08:00
},
optimization: {
minimize: true,
2020-09-02 23:35:10 +08:00
minimizer: [new TerserPlugin()]
}
2018-03-15 00:00:41 +08:00
};