-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Angular with ESBuild produces massive number of tiny chunks #27418
Comments
Just spotted one very telling piece of the puzzle with this bug. We are using Dexie library for caching data into indexedDB. We did not indicate anywhere we want that module extracted into a chunk, neither in config nor in importing coding patterns. But you can see Angular decided to split that quite tidy small piece of code into a separate chunk, for no reason whatsoever. Does it help for a page to have hundreds of HTTP requests? |
It looks like you already stumbled upon the original issue #26307 |
From the screenshots, it looks like this is serving devmode? The would be the effect of Vite's pre bundling, which can be disabled by setting |
This id a key functionality of Vite, contributing significantly to its exceptional speed, especially noticeable during the development phase when utilizing |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Command
build
Is this a regression?
The previous version in which this bug was not present was
15
Description
Angular build produces hundreds of tiny chunks, totally amounting to less than 20Mb of JS.
It used to produce about the same size JS, with 4-6 chunks depending on settings.
There doesn't seem to exist a built-in way to fix the 'chunk explosion' either in the config, in the built-in Angular tools, or any known way to extend Angular to fix it on our side.
Minimal Reproduction
We are using Angular to build a small-to-moderate sized app that is then deployed into several environments, including being hosted by large Apache instance, by nginx in a cloud host and some other setups for beta-testing.
Some web hosts support newer HTTP protocols, others don't.
Some proxy paths between web hosts and end-point browsers handle newer HTTP traffic in better ways, other less so.
Both deployment processes and user experience is severely harmed by this 'explosion' of build artifacts.
A. User Experience
B. Deployment process
rsync
command turns from 3-4 minutes to 30-40 minutesAll in all, dealing with hundreds of build artifacts instead of handful increases operational costs and operational risks proportionally.
If we can get a path forward within Angular+ESBuild pipeline, even building necessary extension ourselves — that would be much appreciated.
Exception or Error
Your Environment
Anything else relevant?
We are using ESBuild with React in other projects within the same department, and never had any problems with chunks.
ESBuild itself can absolutely bundle code without generation of hundreds of tiny files.
The bug is not with ESBuild, but with however Angular is using ESBuild.
The text was updated successfully, but these errors were encountered: