preserve webpack stats, write client assets elsewhere

This commit is contained in:
Rich Harris
2018-05-26 12:31:43 -04:00
parent 98d0df4320
commit e0b4319c7d
4 changed files with 40 additions and 18 deletions

View File

@@ -61,9 +61,9 @@ async function execute(emitter: EventEmitter, {
webpack_stats: client_stats
});
fs.writeFileSync(path.join(dest, 'client_info.json'), JSON.stringify({
assets: client_stats.toJson().assetsByChunkName
}));
const client_info = client_stats.toJson();
fs.writeFileSync(path.join(dest, 'client_info.json'), JSON.stringify(client_info));
fs.writeFileSync(path.join(dest, 'client_assets.json'), JSON.stringify(client_info.assetsByChunkName));
const server_stats = await compile(server);
emitter.emit('build', <events.BuildEvent>{