I pulled down the babylonjs-webpack-es6 repository and built it in an effort to learn more about split chunk control for babylon webpack builds.
From the guide here Code splitting and Chunks using known bundlers | Babylon.js Documentation it claims that when I use the split chunk optimization in my webpack config I should only see 4 chunks alongside my main.mjs
bundle. (webgpu-shaders.mjs
, webgpu-extensions.mjs
, webgl-shaders.mjs
, and babylonBundle.mjs
).
However, when I do a fresh clean build on the repo I still see the various chunk files as shown at the top of the guide. See from my cloned repo dist:
While working on a webpack babylon project of my own I ran into an odd issue where when I built my package locally, the dist would be filled with tons of generated chunk files, but if my gitlab pipeline built my changes the produced package would have the split chunk cache group in the dist as expected.
With this result I am partial to thinking the issue is something with my machine, but I am not sure at all what the cause is.
All I need to do to reproduce the issue is pull down a clean clone of the example repo and build it using npm run build
from the package.json
I have made no changes to the repo. Any thoughts on how I can get the split chunk cache groups to work on a local build would be very helpful.
Thank you
My installed npm version is 10.2.1
My installed node version is 20.18.2