Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tamaina committed May 1, 2022
1 parent 193de40 commit 12741b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions packages/backend/src/server/web/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,16 @@ serverAdapter.setBasePath(bullBoardPath);
app.use(serverAdapter.registerPlugin());
//#endregion

const clientEntry = process.env.NODE_ENV === 'production' ?
config.clientEntry :
JSON.parse(readFileSync(`${_dirname}/../../../../../built/_client_dist_/manifest.json`, 'utf-8'))['src/init.ts'].file.replace(/^_client_dist_\//, '')

// Init renderer
app.use(views(_dirname + '/views', {
extension: 'pug',
options: {
version: config.version,
clientEntry: () => process.env.NODE_ENV === 'production' ?
config.clientEntry :
JSON.parse(readFileSync(`${_dirname}/../../../../../built/_client_dist_/manifest.json`, 'utf-8'))['src/init.ts'].file.replace(/^_client_dist_\//, ''),
clientEntry,
config,
},
}));
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/server/web/views/base.pug
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ html

script.
var VERSION = "#{version}";
var CLIENT_ENTRY = "#{clientEntry()}";
var CLIENT_ENTRY = "#{clientEntry}";

script
include ../boot.js
Expand Down

0 comments on commit 12741b3

Please sign in to comment.