Skip to content
11 changes: 9 additions & 2 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,15 @@ module.exports = {
{
resolve: "gatsby-plugin-webpack-bundle-analyser-v2",
options: {
disable: true,
},
devMode: true,
disable: process.env.NODE_ENV !== "production",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be not better if it is enabled for development also because we want analyzer to run for dev mode too to check various things like the bundle size and all?

Comment on lines +37 to +38
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both will contradicts to each other

analyzerMode: "server",
reportFilename: "./report.html",
openAnalyzer: true,
analyzerPort: "8888",
analyzerHost: "http://localhost",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the build is failing because the webpack bundle analyzer is configured with analyzerHost: "http://localhost", but this option expects only the hostname (for example, "localhost") and not a full URL.
After modifying this, the build started working as expected.

defaultSizes: "gzip"
}
},
{
resolve: "gatsby-plugin-sitemap",
Expand Down
Loading