Skip to content

Commit

Permalink
update build script to append a / to PUBLIC_URL
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesamcl committed Nov 14, 2024
1 parent d7488d2 commit 18cac01
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions webapp/grebi_ui/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 || "/")
);

///
Expand Down

0 comments on commit 18cac01

Please sign in to comment.