Do not manually bundle

This commit is contained in:
Joseph Garrone
2024-05-19 04:21:35 +02:00
parent a28a1531d9
commit 59f8119047
3 changed files with 9 additions and 22 deletions

View File

@ -37,26 +37,6 @@ transformCodebase({
fs.rmSync(join("dist", "ncc_out"), { "recursive": true });
{
const before = fs.readFileSync(join("dist", "bin", "main.js")).toString("utf8");
const search = `fs
.readFileSync((0, path_1.join)(__dirname, "ftl_object_to_js_code_declaring_an_object.ftl"))`;
const after = before.replace(
search,
[
`Buffer.from("`,
fs.readFileSync(join("src", "bin", "keycloakify", "generateFtl", "ftl_object_to_js_code_declaring_an_object.ftl")).toString("base64"),
`", "base64")`
].join("")
);
assert(after !== before, "Ned to update the code that bundles the ftl file");
fs.writeFileSync(join("dist", "bin", "main.js"), Buffer.from(after, "utf8"));
}
fs.chmodSync(
join("dist", "bin", "main.js"),
fs.statSync(join("dist", "bin", "main.js")).mode | fs.constants.S_IXUSR | fs.constants.S_IXGRP | fs.constants.S_IXOTH