mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(editor-ui): fix BASE_URL
replacement on windows (#4202)
This commit is contained in:
parent
b809a2a074
commit
5f0c65690b
|
@ -1755,7 +1755,7 @@ class App {
|
|||
const editorUiPath = require.resolve('n8n-editor-ui');
|
||||
const filePath = pathJoin(pathDirname(editorUiPath), 'dist', 'index.html');
|
||||
const n8nPath = config.getEnv('path');
|
||||
const basePathRegEx = /\/%BASE_PATH%\//g;
|
||||
const basePathRegEx = /\/{{BASE_PATH}}\//g;
|
||||
|
||||
let readIndexFile = readFileSync(filePath, 'utf8');
|
||||
readIndexFile = readIndexFile.replace(basePathRegEx, n8nPath);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<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">
|
||||
<script type="text/javascript">window.BASE_PATH = "/%BASE_PATH%/";</script>
|
||||
<script type="text/javascript">window.BASE_PATH = "/{{BASE_PATH}}/";</script>
|
||||
<title>n8n.io - Workflow Automation</title>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"url": "git+https://github.com/n8n-io/n8n.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "cross-env VUE_APP_PUBLIC_PATH=\"/%BASE_PATH%/\" NODE_OPTIONS=\"--max-old-space-size=8192\" vite build",
|
||||
"build": "cross-env VUE_APP_PUBLIC_PATH=\"/{{BASE_PATH}}/\" NODE_OPTIONS=\"--max-old-space-size=8192\" vite build",
|
||||
"dev": "npm run serve",
|
||||
"lint": "tslint -p tsconfig.json -c tslint.json && eslint .",
|
||||
"lintfix": "tslint --fix -p tsconfig.json -c tslint.json && eslint . --fix",
|
||||
|
|
|
@ -56,7 +56,7 @@ function getTemplatesRedirect(store: Store<IRootState>) {
|
|||
const router = new Router({
|
||||
mode: 'history',
|
||||
// @ts-ignore
|
||||
base: window.BASE_PATH === '/%BASE_PATH%/' ? '/' : window.BASE_PATH,
|
||||
base: window.BASE_PATH === '/{{BASE_PATH}}/' ? '/' : 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) {
|
||||
|
|
|
@ -59,7 +59,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 ? import.meta.env.VUE_APP_URL_BASE_API : (window.BASE_PATH === '/{{BASE_PATH}}/' ? '/' : window.BASE_PATH),
|
||||
defaultLocale: 'en',
|
||||
endpointWebhook: 'webhook',
|
||||
endpointWebhookTest: 'webhook-test',
|
||||
|
|
|
@ -44,5 +44,5 @@ module.exports = {
|
|||
},
|
||||
},
|
||||
},
|
||||
publicPath: process.env.VUE_APP_PUBLIC_PATH ? process.env.VUE_APP_PUBLIC_PATH : '/',
|
||||
publicPath: process.env.VUE_APP_PUBLIC_PATH ?? '/',
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue