From 77f95ebc607a6ca29a2315eb60b8c52598745881 Mon Sep 17 00:00:00 2001 From: Giddh's Black Tiger Date: Thu, 23 Apr 2026 13:58:44 +0530 Subject: [PATCH 1/2] fix: enforce base href="/" in app shell to prevent incorrect JS chunk loading from /app/ path --- tools/postbuild.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/postbuild.js b/tools/postbuild.js index 2603c8d9..8dde0d23 100644 --- a/tools/postbuild.js +++ b/tools/postbuild.js @@ -82,8 +82,16 @@ readDir(path.join(__dirname, rootDirectiory)) if (!fs.existsSync(appShellDir)) { fs.mkdirSync(appShellDir, { recursive: true }); } - fs.copyFileSync(csrHtmlPath, appShellPath); - console.log(`Copied index.csr.html → app/index.html`); + + let appShellHtml = fs.readFileSync(csrHtmlPath, 'utf8'); + + // Force base href to "/" so JS chunks load from the root, not from /app/ + if (!appShellHtml.includes('')) { + appShellHtml = appShellHtml.replace(//i, ''); + } + + fs.writeFileSync(appShellPath, appShellHtml); + console.log(`Copied index.csr.html → app/index.html (base href enforced)`); } else { console.log('index.csr.html not found, skipping app/index.html copy'); } From 9e1da67d96ebdb936bef42031f77b43faeb19aac Mon Sep 17 00:00:00 2001 From: Giddh's Black Tiger Date: Thu, 23 Apr 2026 16:04:33 +0530 Subject: [PATCH 2/2] Revert "fix: enforce base href="/" in app shell to prevent incorrect JS chunk loading from /app/ path" This reverts commit 77f95ebc607a6ca29a2315eb60b8c52598745881. --- tools/postbuild.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/tools/postbuild.js b/tools/postbuild.js index 8dde0d23..2603c8d9 100644 --- a/tools/postbuild.js +++ b/tools/postbuild.js @@ -82,16 +82,8 @@ readDir(path.join(__dirname, rootDirectiory)) if (!fs.existsSync(appShellDir)) { fs.mkdirSync(appShellDir, { recursive: true }); } - - let appShellHtml = fs.readFileSync(csrHtmlPath, 'utf8'); - - // Force base href to "/" so JS chunks load from the root, not from /app/ - if (!appShellHtml.includes('')) { - appShellHtml = appShellHtml.replace(//i, ''); - } - - fs.writeFileSync(appShellPath, appShellHtml); - console.log(`Copied index.csr.html → app/index.html (base href enforced)`); + fs.copyFileSync(csrHtmlPath, appShellPath); + console.log(`Copied index.csr.html → app/index.html`); } else { console.log('index.csr.html not found, skipping app/index.html copy'); }