Created
December 11, 2019 21:39
-
-
Save amazzalel-habib/80a4ddd48a11ab9514306f2b7a414517 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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