fix (backend): pug config loading

This commit is contained in:
naskya 2024-05-19 19:10:58 +09:00
parent 2f4c30176d
commit 9dbf6d07c4
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C
2 changed files with 8 additions and 12 deletions

View file

@ -88,21 +88,20 @@ serverAdapter.setBasePath(bullBoardPath);
app.use(serverAdapter.registerPlugin()); app.use(serverAdapter.registerPlugin());
//#endregion //#endregion
const clientEntry = JSON.parse(
readFileSync(
`${_dirname}/../../../../../built/_client_dist_/manifest.json`,
"utf-8",
),
)["src/init.ts"];
// Init renderer // Init renderer
app.use( app.use(
views(`${_dirname}/views`, { views(`${_dirname}/views`, {
extension: "pug", extension: "pug",
options: { options: {
version: config.version, version: config.version,
getClientEntry: () => clientEntry,
process.env.NODE_ENV === "production"
? config.clientEntry
: JSON.parse(
readFileSync(
`${_dirname}/../../../../../built/_client_dist_/manifest.json`,
"utf-8",
),
)["src/init.ts"],
config, config,
}, },
}), }),

View file

@ -1,8 +1,5 @@
block vars block vars
block loadClientEntry
- const clientEntry = getClientEntry();
doctype html doctype html
// //