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

upgrade Rollup, add back install treeshaking #421

Merged
merged 3 commits into from
Jun 5, 2020
Merged

Conversation

FredKSchott
Copy link
Owner

This PR adds back our old tree-shaking algorithm to give you even smaller production builds. As an example, this reduced one user's @fluentui/react usage by 80%. You can enable this yourself via --treeshake, and you can disable via --no-treeshake. Given the amount of testing this got in Snowpack v1, we feel comfortable turning this on by default for builds in the next version.

By happy accident, this upgrade also serves a dual-purpose: improved React handling in the latest version of Rollup (we can remove our special workarounds).

One small issue is that namedExports is no longer supported by Rollup. This is ultimately a good thing: it was removed because Rollup got good enough at CJS interop to no longer need it. But, this will cause an error for anyone who defined namedExports in their project config, with instructions to resolve.

@FredKSchott FredKSchott force-pushed the rollup-upgrade branch 2 times, most recently from f62df1c to c155d40 Compare June 4, 2020 07:39
@FredKSchott FredKSchott merged commit 6778b68 into master Jun 5, 2020
@FredKSchott FredKSchott deleted the rollup-upgrade branch June 5, 2020 07:38
@lessless
Copy link

lessless commented Jun 5, 2020

Great stuff!

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.

Upgrade to @rollup/plugin-commonjs v12+ Enable better tree-shaking in builds
2 participants