Skip to content

Commit

Permalink
webpack@4 / webpack@next will support `package.json:sideEffects: …
Browse files Browse the repository at this point in the history
…false` wherein libraries can indicate their ESM re-exports are side effect free and can be much more efficiently removed for smaller, faster final bundles. (FormidableLabs#965)

Lodash has already rolled out this change in
https://unpkg.com/lodash-es@4.17.5/package.json

## Issues

This was originally uncovered / discussed at length in:

* webpack/webpack#1750

This PR should resolve the issues discussed in:

* FormidableLabs/victory#549
* FormidableLabs/redux-little-router#262

## Changes

* Add `sideEffects: false` to `package.json` to allow webpack4 tree-shaking to actually remove all unused code.

> This PR has been automatically opened by your friendly [`multibot`](https://github.com/FormidableLabs/multibot/). The transform code and documentation is available at: https://github.com/FormidableLabs/multibot-examples/tree/master/transforms/webpack-side-effects
  • Loading branch information
ryan-roemer authored and jaredbrookswhite committed Aug 22, 2018
1 parent 27a89cc commit c5ff256
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,6 @@
"scripts": {
"postinstall": ""
}
}
},
"sideEffects": false
}

0 comments on commit c5ff256

Please sign in to comment.