Skip to content

Commit 8f4d7e8

Browse files
Merge pull request #5692 from SmartDever02/fix/issue-5679-windows-monaco-editor-import
fix: resolve Windows path issue with monaco-editor import
2 parents 52bfe12 + 518950e commit 8f4d7e8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

config/webpack.config.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,16 +202,19 @@ export default (webpackEnv) => {
202202
// This alias allows us to import presets as absolute path
203203
presets: path.resolve(paths.appSrc, 'presets/'),
204204
// This alias makes sure we don't pull two different versions of monaco-editor
205-
'monaco-editor': '/node_modules/monaco-editor',
205+
// Use path.resolve to ensure cross-platform compatibility (fixes Windows path issues)
206+
'monaco-editor': path.resolve(paths.appNodeModules, 'monaco-editor'),
206207
// This alias makes sure we're avoiding a runtime error related to this package
207-
'@stoplight/ordered-object-literal$':
208-
'/node_modules/@stoplight/ordered-object-literal/src/index.mjs',
208+
'@stoplight/ordered-object-literal$': path.resolve(
209+
paths.appNodeModules,
210+
'@stoplight/ordered-object-literal/src/index.mjs'
211+
),
209212
src: paths.appSrc,
210213
},
211214
plugins: [
212215
new ModuleScopePlugin(paths.appSrc, [
213216
paths.appPackageJson,
214-
'/node_modules/monaco-editor',
217+
path.resolve(paths.appNodeModules, 'monaco-editor'),
215218
reactRefreshRuntimeEntry,
216219
reactRefreshWebpackPluginRuntimeEntry,
217220
babelRuntimeEntry,

0 commit comments

Comments
 (0)