replace client_assets.json with build.json, include bundler name

This commit is contained in:
Rich Harris
2018-08-28 17:56:46 -04:00
parent 19a5dcad1d
commit 70b5cc86dc
6 changed files with 28 additions and 18 deletions

View File

@@ -64,7 +64,10 @@ async function execute(emitter: EventEmitter, {
result: client_result
});
fs.writeFileSync(path.join(dest, 'client_assets.json'), JSON.stringify(client_result.assetsByChunkName));
fs.writeFileSync(path.join(dest, 'build.json'), JSON.stringify({
bundler,
assets: client_result.assetsByChunkName
}));
const server_stats = await server.compile();
emitter.emit('build', <events.BuildEvent>{

View File

@@ -271,7 +271,10 @@ class Watcher extends EventEmitter {
},
handle_result: (result: CompileResult) => {
fs.writeFileSync(path.join(dest, 'client_assets.json'), JSON.stringify(result.assetsByChunkName, null, ' '));
fs.writeFileSync(path.join(dest, 'build.json'), JSON.stringify({
bundler: this.bundler,
assets: result.assetsByChunkName
}, null, ' '));
this.deferreds.client.fulfil();
const client_files = result.assets.map((file: string) => `client/${file}`);