chore: fix js fetch error
This commit is contained in:
+2
-1
@@ -11,12 +11,13 @@ window.addEventListener('vite:preloadError', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const BASE_URL = (window as any).__BASE_URL__ || ''
|
const BASE_URL = (window as any).__BASE_URL__ || ''
|
||||||
|
const origin = window.location.origin
|
||||||
|
|
||||||
createApp(App)
|
createApp(App)
|
||||||
.use(router)
|
.use(router)
|
||||||
.use(VueMonacoEditorPlugin, {
|
.use(VueMonacoEditorPlugin, {
|
||||||
paths: {
|
paths: {
|
||||||
vs: BASE_URL + '/assets/vs'
|
vs: `${origin}${BASE_URL}/assets/vs`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.mount('#app')
|
.mount('#app')
|
||||||
|
|||||||
@@ -97,8 +97,5 @@ export default defineConfig({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
define: {
|
define: {
|
||||||
// Define MONACO_BASE_URL for monaco-editor to correctly load its workers and assets
|
|
||||||
// This path should match the destination of viteStaticCopy for monaco-editor's 'vs' folder
|
|
||||||
MONACO_BASE_URL: JSON.stringify('./assets/vs')
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user