From a10a14bc794ab93823748e679dbb737f675fa84a Mon Sep 17 00:00:00 2001 From: Suguru Inoue Date: Tue, 2 Sep 2025 11:49:10 +0200 Subject: [PATCH] refactor(editor): Simplify config script insertion in dev mode (#18947) --- packages/frontend/editor-ui/vite.config.mts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/frontend/editor-ui/vite.config.mts b/packages/frontend/editor-ui/vite.config.mts index ef0f374a51..c119718f24 100644 --- a/packages/frontend/editor-ui/vite.config.mts +++ b/packages/frontend/editor-ui/vite.config.mts @@ -126,9 +126,14 @@ const plugins: UserConfig['plugins'] = [ { name: 'Insert config script', transformIndexHtml: (html, ctx) => { - // Skip config script when using Vite dev server. Otherwise the BE + // Skip config tags when using Vite dev server. Otherwise the BE // will replace it with the actual config script in cli/src/commands/start.ts. - return ctx.server ? html.replace('%CONFIG_SCRIPT%', '') : html; + return ctx.server + ? html + .replace('%CONFIG_TAGS%', '') + .replaceAll('/{{BASE_PATH}}', '//localhost:5678') + .replaceAll('/{{REST_ENDPOINT}}', '/rest') + : html; }, }, // For sanitize-html