0

I have my static web application written in Gatsby React, and I wanted to disable the webpack option of generating javascript code in chunks, because we were getting some chunk load errors, and found it to be a unsustainable practise. I disabled that option setting it within the file gatsby-node.js file like so:

exports.onCreateWebpackConfig = ({ getConfig, actions }) => {
  const config = getConfig();
  const newConfig = {
    ...config,
    devtool: false,
    optimization: {
      splitChunks: false
    }
  }
  actions.replaceWebpackConfig(newConfig);
};

That fixed our problems with chunks not being fetched, but still when I look into the page sources, we are still getting some chunks in that page. I don't understand why that is... I thought that all of the code would be in one minified js file, without any chunks. Can anyone explain what I am missing? Maybe I shouldn't actually use this option in the configuration of webpack? I was trying to find anything in the gatsby documentation on this option, but I didn't find any explanation for my problem.

enter image description here

ms3300
  • 216
  • 6
  • 13

0 Answers0