change clientEntry sequence
This commit is contained in:
parent
03cd6965fa
commit
743393d9ba
|
@ -74,12 +74,10 @@ 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_\//, ''),
|
||||
config,
|
||||
...(process.env.NODE_ENV !== 'production' ? {
|
||||
process,
|
||||
_dirname,
|
||||
readFileSync: (path: PathOrFileDescriptor): string => readFileSync(path, 'utf8'),
|
||||
} : {}),
|
||||
},
|
||||
}));
|
||||
|
||||
|
|
|
@ -50,16 +50,9 @@ html
|
|||
style
|
||||
include ../style.css
|
||||
|
||||
if process.env.NODE_ENV === 'production'
|
||||
script.
|
||||
var VERSION = "#{version}";
|
||||
var CLIENT_ENTRY = "#{config.clientEntry}";
|
||||
else
|
||||
-
|
||||
const clientEntry = JSON.parse(readFileSync(`${_dirname}/../../../../../built/_client_dist_/manifest.json`, 'utf-8'))['src/init.ts'].file.replace(/^_client_dist_\//, '');
|
||||
script.
|
||||
var VERSION = "#{version}";
|
||||
var CLIENT_ENTRY = "#{clientEntry}";
|
||||
script.
|
||||
var VERSION = "#{version}";
|
||||
var CLIENT_ENTRY = "#{clientEntry()}";
|
||||
|
||||
script
|
||||
include ../boot.js
|
||||
|
|
Loading…
Reference in New Issue