{"id":20055,"library":"gatsby-plugin-webpack-bundle-analyser-v2","title":"Gatsby Plugin Webpack Bundle Analyser v2","description":"A Gatsby plugin that integrates webpack-bundle-analyzer to visualize bundle output sizes with an interactive zoomable treemap. Current stable version is 1.1.32, updated irregularly. Supports Gatsby v4 and v5. Key differentiator: provides the latest webpack-bundle-analyzer version compared to original gatsby-plugin-webpack-bundle-analyser, and is ESM-compatible. Plugin is disabled in development by default; requires manual devMode option to enable during development.","status":"active","version":"1.1.32","language":"javascript","source_language":"en","source_url":"https://github.com/JimmyBeldone/gatsby-plugin-webpack-bundle-analyser-v2","tags":["javascript","gatsby","gatsby-plugin","gatsby-plugin-webpack-bundle-analyser-v2","webpack-bundle-analyser","webpack","analyser","bundle"],"install":[{"cmd":"npm install gatsby-plugin-webpack-bundle-analyser-v2","lang":"bash","label":"npm"},{"cmd":"yarn add gatsby-plugin-webpack-bundle-analyser-v2","lang":"bash","label":"yarn"},{"cmd":"pnpm add gatsby-plugin-webpack-bundle-analyser-v2","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; plugin extends Gatsby's webpack config.","package":"gatsby","optional":false},{"reason":"Core dependency; provides the bundle analysis functionality.","package":"webpack-bundle-analyzer","optional":false}],"imports":[{"note":"String shorthand works for defaults; object form needed for custom options.","wrong":"module.exports = { plugins: ['gatsby-plugin-webpack-bundle-analyser-v2'] }","symbol":"Plugin Configuration","correct":"module.exports = { plugins: [{ resolve: 'gatsby-plugin-webpack-bundle-analyser-v2', options: { analyzerMode: 'server' } }] }"},{"note":"Plugin is configured via gatsby-config.js, not imported and instantiated directly.","wrong":"const plugin = require('gatsby-plugin-webpack-bundle-analyser-v2'); module.exports = { plugins: [plugin] }","symbol":"Use in gatsby-config.js with options","correct":"module.exports = { plugins: [ { resolve: 'gatsby-plugin-webpack-bundle-analyser-v2', options: { devMode: true } } ] }"},{"note":"devMode expects boolean, not string.","wrong":"options: { devMode: 'true' }","symbol":"Dev mode activation","correct":"options: { devMode: true }"}],"quickstart":{"code":"// gatsby-config.js\nmodule.exports = {\n  plugins: [\n    {\n      resolve: 'gatsby-plugin-webpack-bundle-analyser-v2',\n      options: {\n        analyzerMode: 'server',\n        analyzerPort: 3001,\n        defaultSizes: 'gzip',\n      },\n    },\n  ],\n};\n\n// Run build: gatsby build\n// Browser opens automatically with bundle analysis.","lang":"javascript","description":"Configures the plugin with custom analyzer options and runs a build to open the bundle analysis in a browser."},"warnings":[{"fix":"Add options: { devMode: true } to plugin configuration in gatsby-config.js.","message":"Plugin is disabled in development mode by default. Builds will not open analyzer unless devMode: true is set.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure Gatsby version satisfies peer dependency (^4.0.0 || ^5.0.0). If issues arise, pin plugin version to 1.1.25.","message":"The plugin uses webpack-bundle-analyzer v4+, which may break if Gatsby's webpack version is incompatible.","severity":"gotcha","affected_versions":">=1.1.26"},{"fix":"Use gatsby-plugin-webpack-bundle-analyzer if you need more active maintenance.","message":"gatsby-plugin-webpack-bundle-analyser-v2 may be less actively maintained; check for updates or consider alternatives like gatsby-plugin-webpack-bundle-analyzer.","severity":"deprecated","affected_versions":">=1.1.32"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run npm install webpack-bundle-analyzer --save-dev","cause":"Missing dependency of webpack-bundle-analyzer.","error":"Error: Cannot find module 'webpack-bundle-analyzer'"},{"fix":"Use exact string: 'gatsby-plugin-webpack-bundle-analyser-v2'","cause":"Plugin name misspelled or wrong format in gatsby-config.js.","error":"Error: The plugin \"gatsby-plugin-webpack-bundle-analyser-v2\" is not a valid plugin."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}