Skip to content

Commit

Permalink
Declared package side effects free
Browse files Browse the repository at this point in the history
This sets the package.json field sideEffects to false. This allows for better tree shaking by downstream consumers, see https://webpack.js.org/guides/tree-shaking/#mark-the-file-as-side-effect-free for more information.

I skimmed over all included files and I did not see anything that would count following webpack's definition of tree shaking during a production build.

There is one side effect, but I believe its only used in development builds, so it would be okay to tree shake:
https://github.com/bvaughn/react-window/blob/master/src/createListComponent.js#L127-L136

For more details on how this field works and why it matter see the discussion here: react-dnd/react-dnd#1577
  • Loading branch information
maclockard authored Nov 21, 2019
1 parent c43a2ee commit 71e0ab7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"files": ["dist", "src/*.js"],
"sideEffects": false,
"scripts": {
"flow": "flow check --max-warnings=0 src && flow check website",
"precommit": "lint-staged",
Expand Down

0 comments on commit 71e0ab7

Please sign in to comment.