Skip to content
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

Too many small chunks #2901

Open
alexblack opened this issue Feb 8, 2023 · 1 comment · May be fixed by #3302
Open

Too many small chunks #2901

alexblack opened this issue Feb 8, 2023 · 1 comment · May be fixed by #3302

Comments

@alexblack
Copy link

We're using Remix, which uses esbuild, and our webapp build produces 91 chunks, about 50% of which are less than 1kb, which means our webpages import around 30-35 chunks, which I think is really inefficient for the browser.

Are there any good work arounds to avoid this?

One of our chunks is:

var e="web";export{e as a};

This appears to be coming from a single typescript file with a single constant in it... so I guess I can fix that by moving the constant to another file.

There are a few like this:

import{b as o}from"/build/_shared/chunk-2LOM2E4Y.js";var p=o((r,e)=>{e.exports={}});export{p as a};
//# sourceMappingURL=/build/_shared/chunk-SIMRMZHU.js.map
@alexblack
Copy link
Author

I'm reviewing a few of these tiny chunks, and they are usually from tiny TS files in our repo.... so I guess the solution is to start consolidating our files, and avoiding having tiny files like this? I imagine I should think carefully about which code to co-locate?

@ArrayZoneYour ArrayZoneYour linked a pull request Aug 9, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant