mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 09:36:44 +00:00
refactor(editor): Simplify config script insertion in dev mode (#18947)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user