Gatsby Webpack Bundle Analyzer
by John Vincent
Posted on September 24, 2019
This stuff ends up sprayed everywhere, so let's create a reference document.
Gatsby Webpack Bundle Analyzer
gatsby-plugin-webpack-bundle-analyser-v2
Install
npm i --save-dev gatsby-plugin-webpack-bundle-analyser-v2Using the plugin gatsby-plugin-webpack-bundle-analyser-v2, add to gatsby-config.js
{
resolve: `gatsby-plugin-webpack-bundle-analyser-v2`,
options: {
analyzerMode: `server`,
analyzerPort: `8888`,
},
},Run the production build
npm run buildView the report
http://127.0.0.1:8888/Other Options
analyzerHost: "http://myhost.com",
devMode: true,
disable: trueas plugin:
- is disabled in
dev modeby default - should be disabled with
disable: truefor real production.