如何在创建反应应用程序中构建 bundle-stats.json?

Yer*_*nov 4 reactjs webpack create-react-app

我需要构建 bundle-stats.json 才能使用 webpack-bundle-analyzer。在这里,我如何尝试构建它,但它不会创建任何文件。

npm run build -- --stats
Run Code Online (Sandbox Code Playgroud)

请你帮助我好吗

Dav*_*zar 14

在此 PR中,该--stats标志已重新添加到 CRA 中。

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


fla*_*ght 7

stats已从查看中删除CRA

建议使用 source-map-explorer

npm i -g source-map-explorer
source-map-explorer 'build/static/js/*.js'.
Run Code Online (Sandbox Code Playgroud)