https://www.npmjs.com/package/webpack-bundle-analyzer
npm i --save-dev webpack-bundle-analyzer
touch analyze.js
node analyze.js
https://www.npmjs.com/package/webpack-bundle-analyzer
npm i --save-dev webpack-bundle-analyzer
touch analyze.js
node analyze.js
process.env.NODE_ENV = "production"; | |
var BundleAnalyzerPlugin = require("webpack-bundle-analyzer") | |
.BundleAnalyzerPlugin; | |
const webpackConfigProd = require("react-scripts/config/webpack.config.prod"); | |
webpackConfigProd.plugins.push( | |
new BundleAnalyzerPlugin({ | |
analyzerMode: "static", | |
reportFilename: "report.html" | |
}) | |
); | |
require("react-scripts/scripts/build"); |