Currently I am migrating some boilerplate code from Webpack v4 to v5 and I am stuck with the produced output.
In my webpack config, I use single-file entry & the splitChunks option to separate the game code from the libraries I am using.
optimization: {
splitChunks: {
chunks: "all",
},
}
output -
output: {
path: path.resolve(__dirname, "dist"),
filename: "game.[contenthash].js",
chunkFilename: "game-libraries.[contenthash].js",
},
So when I run the build I get the files split, but they both go with the filename structure.
ex produced build -
game.4c49dce85aa02822c28d.js
game.f4e81e5394bdc5feaa3b.js
And I feel like the chunkFilename option is being ignored.
What am i missing?