[Vuejs]-Webpack splitchunks creates dynamic chunk file

0👍

After upgrading from Webpack v4 to v5 I had a similar problem. There were a couple of chunks with "~" in their filename.

This splitChunks configuration got me back to only one bundle file per entrypoint, and one shared vendor bundle.

optimization: {
    splitChunks: {
       cacheGroups: {
          commons: {
             test: /[\\/]node_modules[\\/]/,
             name: "vendor",
             chunks: "initial",
          },
       }
    }
}

Leave a comment