mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
fix(editor-ui): fix axios baseUrl when hosted under a subfolder (#4336)
* fix(editor-ui): fix axios baseUrl when hosted under a subfolder * don't rewrite the favicon url twice * setup a base href for all relative urls * fix static urls
This commit is contained in:
committed by
GitHub
parent
6a37071350
commit
c2e9a03ac5
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user