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

consider dropping some builds #255

Open
benmccann opened this issue Jun 15, 2023 · 0 comments
Open

consider dropping some builds #255

benmccann opened this issue Jun 15, 2023 · 0 comments

Comments

@benmccann
Copy link

benmccann commented Jun 15, 2023

I wanted to suggest some changes that would make the package size a bit smaller. These are breaking changes, so would probably have to be done with the next major version.

The motivation for this suggestion is that learn.svelte.dev loads all Svelte dependencies and css-tree is the largest of those dependencies at 1.3 MB. If we're able to slim this down a bit then the tutorial could load a little faster for users.

One idea I had was possibly dropping the browser builds under dist. These are bundled versions of css-tree which makes it possible to load css-tree from a CDN. I would guess that the majority of users get css-tree from npm. The remaining users could switch to npm and build their own bundle saving 499 kB from the css-tree package.

Another, probably more controversial, idea would be dropping the CJS build. As more and more users switch to ESM the CJS build becomes less necessary and becomes extra weight. The cjs folder is 403 kB. ESM users can use the ESM version directly. CJS users can use the ESM version via dynamic import.

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

No branches or pull requests

1 participant