Cannot combine bundle chunks with webpack

I’ll repeat something I wrote before - a reproduction will be very helpful, otherwise we are just talking about code that I know nothing about.

hundreds of chunks means you are using a lot of the framework. If not all of it.

Want to share your project? we can look into it. Otherwise - the configuration is provided. Even with the few chunks that are left, I am sure the network congestion you mentioned is not an issue, so you can at least continue developing.

Have you read webpack’s chunk optimization documentation? Have you tried solving it?

2 Likes

Im going to try and see if I can recreate it in a mock project to push up. I unfortunately cannot share the main project code. Thanks for all the assistance.

I was able to recreate the issue in a new project that reflects my environment.

bab-chunk-test

In the readme also but to run

  1. Navigate to babylon-package and run npm i then npm run build

  2. Navigate to test-app and run npm i then npm run start

If it reproduces correctly what you should see is no chunk files in the dist folder, and when the angular app is served a ton of chunk files will be created for the build.

(There is a chance you may need to uninstall and reinstall the babylon package into the angular app as well but that should just be:
npm uninstall 'babylonjs-typescript-webpack-template && npm install ../babylon-package/

You mark babylon as external. So the one bundling it is not the babylon project, it is the angular project.

3 Likes