Fixed subdirectory path replacement

The minified bundle variable name changed.
This should sort it out
This commit is contained in:
Aurora Lahtela 2023-02-17 17:45:32 +02:00
parent 701f4d3393
commit 020e49e0d5
2 changed files with 4 additions and 4 deletions

View File

@ -109,8 +109,8 @@ public class ReactExporter extends FileExporter {
} else if (path.endsWith(".js")) {
String withReplacedConstants = StringUtils.replaceEach(
resource.asString(),
new String[]{"PLAN_BASE_ADDRESS", "PLAN_EXPORTED_VERSION", "n.p=\"/\""},
new String[]{config.get(WebserverSettings.EXTERNAL_LINK), "true", "n.p=\"" + getBasePath() + "/\""}
new String[]{"PLAN_BASE_ADDRESS", "PLAN_EXPORTED_VERSION", ".p=\"/\""},
new String[]{config.get(WebserverSettings.EXTERNAL_LINK), "true", ".p=\"" + getBasePath() + "/\""}
);
export(to, withReplacedConstants);
} else {

View File

@ -245,8 +245,8 @@ public class ResponseFactory {
return locale.replaceLanguageInJavascript(contents);
})
.chain(contents -> StringUtils.replace(contents,
"n.p=\"/\"",
"n.p=\"" + getBasePath() + "/\""))
".p=\"/\"",
".p=\"" + getBasePath() + "/\""))
.apply();
ResponseBuilder responseBuilder = Response.builder()
.setMimeType(MimeType.JS)