Skip to content

Commit c5fd267

Browse files
committed
build(webpack): fix paths to apidom and editor workers in umd/esm
1 parent 7bdfc72 commit c5fd267

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

packages/react-scripts/config/webpack.config.bundle.esm.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,12 @@ module.exports = function (webpackEnv) {
2929
...pluginEntries,
3030
...presetEntries,
3131
'apidom.worker': path.join(
32-
paths.appSrc,
33-
'plugins',
34-
'editor-monaco-language-apidom',
35-
'language',
36-
'apidom.worker.js'
32+
paths.appPath,
33+
process.env.REACT_APP_APIDOM_WORKER_PATH
3734
),
38-
'editor.worker': require.resolve(
39-
'monaco-editor/esm/vs/editor/editor.worker.js'
35+
'editor.worker': path.join(
36+
paths.appPath,
37+
process.env.REACT_APP_EDITOR_WORKER_PATH
4038
),
4139
};
4240
config.output.path = paths.appDist;

packages/react-scripts/config/webpack.config.bundle.umd.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,8 @@ const apidomWorkerConfig = webpackEnv => {
164164

165165
config.entry = {
166166
'apidom.worker': path.join(
167-
paths.appSrc,
168-
'plugins',
169-
'editor-monaco-language-apidom',
170-
'language',
171-
'apidom.worker.js'
167+
paths.appPath,
168+
process.env.REACT_APP_APIDOM_WORKER_PATH
172169
),
173170
};
174171

@@ -205,8 +202,9 @@ const editorWorkerConfig = webpackEnv => {
205202
const config = commonConfig(webpackEnv);
206203

207204
config.entry = {
208-
'editor.worker': require.resolve(
209-
'monaco-editor/esm/vs/editor/editor.worker.js'
205+
'editor.worker': path.join(
206+
paths.appPath,
207+
process.env.REACT_APP_EDITOR_WORKER_PATH
210208
),
211209
};
212210

0 commit comments

Comments
 (0)