Below are some options from an open-webpack (not CRA) react project:
// webpack.config.js
module.exports = {
// ...
entry: {
main: './src/index.js',
'editor.worker': 'monaco-editor/esm/vs/editor/editor.worker.js',
'yaml.worker': 'monaco-yaml/lib/esm/yaml.worker.js',
},
// ...
How to implement similar configuration in config-overrides.js
(using react-app-rewired)?
// config-overrides.js
module.exports = function override (config) {
config.entry = // ???
return config
}
My experience:
Simply set it to:
config.entry = {
main: './src/index.js',
'editor.worker': 'monaco-editor/esm/vs/editor/editor.worker.js',
'yaml.worker': 'monaco-yaml/lib/esm/yaml.worker.js',
}
doesn't work. It even causes issues in loading index.js
!