diff --git a/frontend/runtimeSetup.js b/frontend/runtimeSetup.js
index 6f86d2c..e656e4b 100644
--- a/frontend/runtimeSetup.js
+++ b/frontend/runtimeSetup.js
@@ -39,7 +39,8 @@ function updateIndexHtml(envFileName, basePath) {
// Replace any existing env script with the new one
const envScriptRegex = /`;
+ const scriptSrc = basePath ? `${basePath.endsWith("/") ? basePath : basePath + "/"}${envFileName}` : envFileName;
+ const newEnvScript = ``;
if (envScriptRegex.test(indexContent)) {
indexContent = indexContent.replace(envScriptRegex, newEnvScript);
@@ -53,7 +54,7 @@ function updateIndexHtml(envFileName, basePath) {
}
fs.writeFileSync(indexPath, indexContent, "utf8");
- console.log(`Updated ${indexPath} with base path: ${basePath || "/"} and env script: ${envFileName}`);
+ console.log(`Updated ${indexPath} with base path: ${basePath || "/"} and env script: ${scriptSrc}`);
}
function cleanupOldEnvFiles(newEnvFileName) {