Skip to content

Instantly share code, notes, and snippets.

@agrcrobles
Created December 18, 2018 08:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agrcrobles/54a570822901e8cb2530f7d6615b210f to your computer and use it in GitHub Desktop.
Save agrcrobles/54a570822901e8cb2530f7d6615b210f to your computer and use it in GitHub Desktop.
webpack bundle analyzer with create-react-app
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");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment