Files
react/examples/tree-shaking-create-react-app
2020-08-24 18:40:07 +08:00
..
2020-05-16 23:05:11 +08:00
2020-08-24 18:40:07 +08:00
2020-08-24 18:40:07 +08:00
2020-08-24 18:40:07 +08:00

Tree shaking for create react app

This is example of tree-shaking for create-react-app. By default, we do not eject configs from create-react-app, in this example, we use react-app-rewired to change the default configs.

About

  • Add config-overrides.js to your root folder.
  • Add deps: yarn add babel-plugin-import customize-cra react-app-rewired -D
  • Replace your default scripts(react-scripts) with react-app-rewired.

Previews

Before:

before


After:

after