diff --git a/README.md b/README.md index 4ad7c466f..f89dec767 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,8 @@ import AutoSizer from 'react-virtualized/dist/commonjs/AutoSizer' import List from 'react-virtualized/dist/commonjs/List' ``` +Note webpack 4 makes this optimization itself, see the [documentation](https://webpack.js.org/guides/tree-shaking/#mark-the-file-as-side-effect-free). + If the above syntax looks too cumbersome, or you import react-virtualized components from a lot of places, you can also configure a Webpack alias. For example: ```js diff --git a/package.json b/package.json index de067e954..d189e8a22 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "main": "dist/commonjs/index.js", "module": "dist/es/index.js", "jsnext:main": "dist/es/index.js", + "sideEffects": false, "license": "MIT", "scripts": { "build:types": "flow-copy-source --ignore \"**/*.{jest,e2e,ssr,example}.js\" source/WindowScroller dist/es/WindowScroller && flow-copy-source --ignore \"**/*.{jest,e2e,ssr,example}.js\" source/AutoSizer dist/es/AutoSizer ",