Skip to content

Commit 6f77c9c

Browse files
markeriksonAndyPengc12
authored andcommitted
Add sideEffects flag to react-is for tree shaking (facebook#27701)
## Summary This PR: - Adds the `"sideEffects": false` flag to the `react-is` package, to enable proper tree-shaking ## How did you test this change? React-Redux v9 beta switches its artifacts from separate JS files to pre-bundled artifacts. While testing builds locally, I noticed that our use of `react-is` was no longer getting tree-shaken from Vite builds, despite `react-is` only being used by our `connect` API and `connect` itself getting shaken out of the final bundle. Hand-adding `"sideEffects": false` to the `react-is` package locally convinced Vite (+Rollup) to properly tree-shake `react-is` out of the bundle when it wasn't being used. I'd love to see this published as v18.2.1 as soon as this PR is merged - we're hoping to release React-Redux v9 in the next few weeks!
1 parent ac747d1 commit 6f77c9c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/react-is/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "18.2.0",
44
"description": "Brand checking of React Elements.",
55
"main": "index.js",
6+
"sideEffects": false,
67
"repository": {
78
"type": "git",
89
"url": "https://github.com/facebook/react.git",

0 commit comments

Comments
 (0)