如何在create react app中构建bundle-stats.json

时间:2019-09-26 08:29:55

标签: reactjs webpack create-react-app

我需要构建bundle-stats.json才能与webpack-bundle-analyzer一起使用。 在这里,我正在尝试构建它,但它没有创建任何文件。

of(1,2,3).pipe(
  map(x => x + 1),
  filter(x => x > 2)
);

您能帮我吗

2 个答案:

答案 0 :(得分:1)

stats已从CRA see

中删除

建议使用source-map-explorer

npm i -g source-map-explorer
source-map-explorer 'build/static/js/*.js'.

答案 1 :(得分:1)

--stats 标志已在 this PR 中重新添加到 CRA 中。

这样您就可以再次使用 webpack-bundle-analyzer