only save the bits of client_info we need

This commit is contained in:
Rich Harris
2018-05-03 23:42:19 -04:00
parent 0b5741194a
commit 1fcf3f79ee
2 changed files with 4 additions and 2 deletions

View File

@@ -35,7 +35,9 @@ export async function build() {
const client_stats = await compile(client);
console.log(`${clorox.inverse(`\nbuilt client`)}`);
console.log(client_stats.toString({ colors: true }));
fs.writeFileSync(path.join(output, 'client_info.json'), JSON.stringify(client_stats.toJson()));
fs.writeFileSync(path.join(output, 'client_info.json'), JSON.stringify({
assets: client_stats.toJson().assetsByChunkName
}));
const server_stats = await compile(server);
console.log(`${clorox.inverse(`\nbuilt server`)}`);

View File

@@ -90,7 +90,7 @@ export default function middleware({ routes, store }: {
cache_control: 'max-age=31536000'
}),
get_route_handler(client_info.assetsByChunkName, routes, store)
get_route_handler(client_info.assets, routes, store)
].filter(Boolean));
return middleware;