diff --git a/packages/cli/src/Server.ts b/packages/cli/src/Server.ts index b80b7053be..eb5da9492c 100644 --- a/packages/cli/src/Server.ts +++ b/packages/cli/src/Server.ts @@ -1798,11 +1798,11 @@ class App { const filePath = pathJoin(editorUiDistDir, fileName); if (/(index\.html)|.*\.(js|css)/.test(filePath) && existsSync(filePath)) { const srcFile = await readFile(filePath, 'utf8'); - let payload = srcFile.replace(basePathRegEx, n8nPath); + let payload = srcFile + .replace(basePathRegEx, n8nPath) + .replace(/\/static\//g, pathJoin(n8nPath, 'static/')); if (filePath.endsWith('index.html')) { - payload = payload - .replace(/\/favicon\.ico/g, `${n8nPath}favicon.ico`) - .replace(closingTitleTag, closingTitleTag + scriptsString); + payload = payload.replace(closingTitleTag, closingTitleTag + scriptsString); } const destFile = pathJoin(generatedStaticDir, fileName); await mkdir(pathDirname(destFile), { recursive: true }); diff --git a/packages/editor-ui/src/router.ts b/packages/editor-ui/src/router.ts index d5f8cc368c..24359f0d45 100644 --- a/packages/editor-ui/src/router.ts +++ b/packages/editor-ui/src/router.ts @@ -56,7 +56,7 @@ function getTemplatesRedirect(store: Store) { const router = new Router({ mode: 'history', // @ts-ignore - base: window.BASE_PATH === '/{{BASE_PATH}}/' ? '/' : window.BASE_PATH, + base: window.BASE_PATH ?? '/', scrollBehavior(to, from, savedPosition) { // saved position == null means the page is NOT visited from history (back button) if (savedPosition === null && to.name === VIEWS.TEMPLATES && to.meta) { diff --git a/packages/editor-ui/src/store.ts b/packages/editor-ui/src/store.ts index fe0e43efdf..acf40671db 100644 --- a/packages/editor-ui/src/store.ts +++ b/packages/editor-ui/src/store.ts @@ -58,7 +58,7 @@ const state: IRootState = { activeNode: null, activeCredentialType: null, // @ts-ignore - baseUrl: import.meta.env.VUE_APP_URL_BASE_API ? import.meta.env.VUE_APP_URL_BASE_API : (window.BASE_PATH === '/{{BASE_PATH}}/' ? '/' : window.BASE_PATH), + baseUrl: import.meta.env.VUE_APP_URL_BASE_API ?? window.BASE_PATH ?? '/', defaultLocale: 'en', endpointWebhook: 'webhook', endpointWebhookTest: 'webhook-test',