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

29 lines
514 B
JavaScript
Raw Normal View History

2020-09-02 23:35:10 +08:00
const path = require('path');
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
module.exports = {
mode: process.env.NODE_ENV,
2020-09-02 23:35:10 +08:00
entry: './index.js',
output: {
2020-09-02 23:35:10 +08:00
path: path.resolve(__dirname, 'dist'),
filename: '[name].bundle.js'
},
module: {
2020-09-02 23:35:10 +08:00
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.ttf$/,
use: ['file-loader']
}
]
},
plugins: [
new MonacoWebpackPlugin({
2020-09-02 23:35:10 +08:00
languages: ['typescript', 'javascript', 'css']
})
]
};