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());
//#endregion
const clientEntry = JSON.parse(
readFileSync(
`${_dirname}/../../../../../built/_client_dist_/manifest.json`,
"utf-8",
),
)["src/init.ts"];
// Init renderer
app.use(
views(`${_dirname}/views`, {
extension: "pug",
options: {
version: config.version,
getClientEntry: () =>
process.env.NODE_ENV === "production"
? config.clientEntry
: JSON.parse(
readFileSync(
`${_dirname}/../../../../../built/_client_dist_/manifest.json`,
"utf-8",
),
)["src/init.ts"],
clientEntry,
config,
},
}),

View file

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