1

Is it normal for splitChunks to output different files in Production and Development mode? Is it possible to make sure the number/name of outputted files is the same between modes?

This is my config:

splitChunks: {
       cacheGroups: {
           vendors: {
              test: /[\\/]node_modules[\\/]/i,
              chunks: "all",
              reuseExistingChunk: true
           }
       }
    }
user2753924
  • 465
  • 1
  • 5
  • 15

1 Answers1

1

It's a feature of Webpack SplitChunksPlugin. By default, in production mode, any chunk smaller than 30kb will be ignored.

You can enforce a minimum chunk size by setting optimization.splitChunks.minSize option to a value smaller than your smallest chunk in development mode, to ensure the same chunks and created in both development and production modes.

S. Esteves
  • 415
  • 4
  • 14