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

build: explicitly mark fns to improve tree-shaking #130

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Apr 8, 2024

Related to #129

(This PR is mainly for experimenting)

Add explicit /* @__PURE__ */ marks to improve tree-shaking with a roll-up. (it does not fully trust sideEffects: false in package.json only)

This only works if the rollup treeshake option is set to smallest and by default does not change any behavior still!

Due to ESBuild limitations for minify options, we have to disable whitespace modification which means the default size of dist/index.mjs goes from 3.96 kB to 4.86 kB.

rollup repl

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 this pull request may close these issues.

1 participant