Skip to content

Instantly share code, notes, and snippets.

@codeStryke
Created October 20, 2021 00:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codeStryke/e193d3bd6ecdad5b741cdf42ce663c7a to your computer and use it in GitHub Desktop.
Save codeStryke/e193d3bd6ecdad5b741cdf42ce663c7a to your computer and use it in GitHub Desktop.
monaco-editor webpack.config.js for sql language
const TerserPlugin = require("terser-webpack-plugin");
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
const path = require('path');
module.exports = {
entry: './index.js',
mode: 'development',
optimization: {
minimize: false,
minimizer: [
new TerserPlugin({
extractComments: false,
terserOptions: {
format: {
comments: false,
},
},
}),
],
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'monaco-editor.esm.js'
},
module: {
rules: [{
test: /\.css$/,
use: ['style-loader', 'css-loader']
}, {
test: /\.ttf$/,
type: 'asset/resource'
}]
},
plugins: [
new MonacoWebpackPlugin({ languages: ['sql'] })
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment