-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
build: shrink size of bundle #576
Conversation
I don't have full context, but esbuild have a somewhat recent packages option to make all node modules external without the need to specify them: https://esbuild.github.io/api/#packages Maybe this can lead to better tradeoff for publishing than disabling completely bundling |
This change atm is broken. The bundle is tiny because there is no code. The reason the bundle is so big is because we are shipping source maps. If we remove them, things will be a lot smaller - a saving of about ~700 kB. The only node dependency being bundled currently is semver - which we shouldn't be doing. I'll fix this up, which will give us another saving. |
D'oh! Thanks, yes please. I haven't investigated much beyond the initial size check.
Relevant: typescript-eslint/typescript-eslint#9352. I'm 👍 on removing them. |
f1eab7e
to
38b9149
Compare
Bundle size is now down to about 360 kB, half of that being types. Also we're releasing both esm and cjs so the actually size of the runtime import is only about 80 kB. |
@JoshuaKGoldberg should be all good now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
Hi, I didn't see this one when I send #587, do you think replace semver with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since GitHub still won't let me approve my own PR (sigh), using this in lieu of an approval.
@RebeccaStevens I'm ready to merge all these PRs in together -hopefully including #587?- and get a full 2.0 release if you're happy!
cd9a8d3
to
8e43dd7
Compare
PR Checklist
status: accepting prs
Overview
Edit: see later comments.
Turns off the ESBuild bundling that was done with tsup. It was including packages fromnode_modules/
. 😩Runningdu -sh lib/
:Baseline (main
): 1.1MWith this change: 184K❤️🔥