Skip to content

Instantly share code, notes, and snippets.

@amazzalel-habib
Created December 11, 2019 21:39
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 amazzalel-habib/80a4ddd48a11ab9514306f2b7a414517 to your computer and use it in GitHub Desktop.
Save amazzalel-habib/80a4ddd48a11ab9514306f2b7a414517 to your computer and use it in GitHub Desktop.
const path = require('path');
const htmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
mode: 'development',
entry: {
app: './src/index.tsx',
"editor.worker": 'monaco-editor-core/esm/vs/editor/editor.worker.js'
},
output: {
globalObject: 'self',
filename: (chunkData) => {
switch (chunkData.chunk.name) {
case 'editor.worker':
return 'editor.worker.js';
default:
return 'bundle.[hash].js';
}
},
path: path.resolve(__dirname, 'dist')
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx', '.css']
},
module: {
rules: [
{
test: /\.tsx?/,
loader: 'ts-loader'
},
{
test: /\.css/,
use: ['style-loader', 'css-loader']
}
]
},
plugins: [
new htmlWebpackPlugin({
template: './src/index.html'
})
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment