Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

perf: enable tree shaking for Webpack #224

Merged
merged 1 commit into from
Sep 13, 2018
Merged

Conversation

levithomason
Copy link
Member

@levithomason levithomason commented Sep 13, 2018

This PR sets sideEffects: false in our package.json to inform Webpack that our library is safe for tree shaking.

https://webpack.js.org/guides/tree-shaking

@dvdzkwsk
Copy link
Contributor

dvdzkwsk commented Sep 13, 2018

giphy

@levithomason levithomason merged commit cf67f87 into master Sep 13, 2018
@levithomason levithomason deleted the chore/tree-shaking branch September 13, 2018 16:31
@brianespinosa
Copy link
Collaborator

@levithomason how much did you benefit in package size from this change? I see you are using Webpack 3. I didn't realize sideEffects: false also worked for this version. The current Webpack docs are for Webpack 4.

@levithomason
Copy link
Member Author

The docs will always import 100% of the features so the size will be maxed at all times. The change here was made for consumers to benefit from.

We are currently working on library level perf tracking #141 and library level bundle size tracking #97. It would be nice to track partial use bundle size as well.

@levithomason
Copy link
Member Author

@brianespinosa ^

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants