From 18cac017f9c600fa6c2ab82e023099b58e18b8f1 Mon Sep 17 00:00:00 2001 From: James McLaughlin Date: Thu, 14 Nov 2024 00:17:39 +0000 Subject: [PATCH] update build script to append a / to PUBLIC_URL --- webapp/grebi_ui/build.mjs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/webapp/grebi_ui/build.mjs b/webapp/grebi_ui/build.mjs index ea28253..03034c4 100644 --- a/webapp/grebi_ui/build.mjs +++ b/webapp/grebi_ui/build.mjs @@ -11,15 +11,16 @@ for (const k in process.env) { /// Build index.html (simple find and replace) /// console.log("### Building index.html"); +var public_url = process.env.PUBLIC_URL.endsWith("/") ? process.env.PUBLIC_URL : process.env.PUBLIC_URL + "/"; fs.writeFileSync( "dist/index.html", fs .readFileSync("index.html.in") .toString() .split("%PUBLIC_URL%/") - .join(process.env.PUBLIC_URL || "/") + .join(public_url || "/") .split("%PUBLIC_URL%") - .join(process.env.PUBLIC_URL || "/") + .join(public_url || "/") ); ///