fix (backend): pug config loading
This commit is contained in:
parent
2f4c30176d
commit
9dbf6d07c4
2 changed files with 8 additions and 12 deletions
|
@ -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,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
block vars
|
block vars
|
||||||
|
|
||||||
block loadClientEntry
|
|
||||||
- const clientEntry = getClientEntry();
|
|
||||||
|
|
||||||
doctype html
|
doctype html
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in a new issue