mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix(editor): Account for subpath when serving config.js (#17832)
Co-authored-by: autologie <suguru@n8n.io>
This commit is contained in:
@@ -5,9 +5,10 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<link rel="stylesheet" href="/static/prefers-color-scheme.css">
|
||||
%CONFIG_SCRIPT%
|
||||
<script src="/static/posthog.init.js" type="text/javascript"></script>
|
||||
<link rel="stylesheet" href="/{{BASE_PATH}}/static/prefers-color-scheme.css">
|
||||
<script src="/{{BASE_PATH}}/static/base-path.js" type="text/javascript"></script>
|
||||
<script src="/{{BASE_PATH}}/static/posthog.init.js" type="text/javascript"></script>
|
||||
|
||||
<title>n8n.io - Workflow Automation</title>
|
||||
</head>
|
||||
|
||||
1
packages/frontend/editor-ui/public/static/base-path.js
Normal file
1
packages/frontend/editor-ui/public/static/base-path.js
Normal file
@@ -0,0 +1 @@
|
||||
window.BASE_PATH = '/{{BASE_PATH}}/';
|
||||
@@ -128,7 +128,7 @@ const plugins: UserConfig['plugins'] = [
|
||||
transformIndexHtml: (html, ctx) => {
|
||||
const replacement = ctx.server
|
||||
? '' // Skip when using Vite dev server
|
||||
: '<script src="/{{REST_ENDPOINT}}/config.js"></script>';
|
||||
: '<script src="/{{BASE_PATH}}/{{REST_ENDPOINT}}/config.js"></script>';
|
||||
|
||||
return html.replace('%CONFIG_SCRIPT%', replacement);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user