From 926806f890df4a09d1f0348cc71c64c8f28a6b17 Mon Sep 17 00:00:00 2001 From: engigu Date: Thu, 26 Mar 2026 12:04:41 +0800 Subject: [PATCH] chore: fix js fetch error --- web/src/main.ts | 3 ++- web/vite.config.ts | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/web/src/main.ts b/web/src/main.ts index aa1870a..3dd7901 100644 --- a/web/src/main.ts +++ b/web/src/main.ts @@ -11,12 +11,13 @@ window.addEventListener('vite:preloadError', () => { }) const BASE_URL = (window as any).__BASE_URL__ || '' +const origin = window.location.origin createApp(App) .use(router) .use(VueMonacoEditorPlugin, { paths: { - vs: BASE_URL + '/assets/vs' + vs: `${origin}${BASE_URL}/assets/vs` } }) .mount('#app') diff --git a/web/vite.config.ts b/web/vite.config.ts index e29df78..7fc0303 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -97,8 +97,5 @@ export default defineConfig({ } }, 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') } })