I need to perform tree-shaking to reduce bundle sizes where lodash and some other libraries are being used.
I've converted all lodash imports like this:
import {isEmpty} from "lodash";
But still bundle size is not getting reduced.
To use plugins like 'lodash-webpack-plugin
', we need to configure in webpack.config.js
, which is not possible in a create-react-app project. I tried using react-app-rewired
but getting issues like:
screenshot of error
Following versions are being used in the project:
- react-scripts: 3.4.1
- webpack: 4.42.0
- react: 16.13.1
- lodash: 4.17.15