Skip to content

Commit

Permalink
fix optimize-stats task (#774)
Browse files Browse the repository at this point in the history
  • Loading branch information
jchip authored May 4, 2018
1 parent 5b39dec commit 2b5c709
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/electrode-archetype-react-app/arch-clap.js
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,11 @@ Individual .babelrc files were generated for you in src/client and src/server
},
"optimize-stats": {
desc: "Generate a list of all files that went into production bundle JS (results in .etmp)",
task: `analyze-bundle -b dist/js/bundle.*.js -s dist/server/stats.json`
task: () => {
const stats = JSON.parse(Fs.readFileSync("dist/server/stats.json"));
const bundle = stats.assetsByChunkName.main.find(x => x.endsWith(".js"));
return `~$analyze-bundle -b dist/js/${bundle} -s dist/server/stats.json`;
}
},
pwa: {
desc: "PWA must have dist by running `clap build` first and then start the app server only.",
Expand Down

0 comments on commit 2b5c709

Please sign in to comment.