mirror of
https://github.com/zhigang1992/react.git
synced 2026-02-12 22:29:35 +08:00
* chore(gh): update GitHub's pull-request template * chore: use unified common prettier config * chore: add the mdx file to prettier * chore(gh): update contributing guide docs
24 lines
644 B
Markdown
24 lines
644 B
Markdown
## Tree shaking for create react app
|
|
|
|
This is example of `tree-shaking` for [create-react-app](https://github.com/facebook/create-react-app).
|
|
By default, we do not `eject` configs from `create-react-app`, in this example,
|
|
we use [react-app-rewired](https://github.com/timarney/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:**
|
|
|
|

|
|
|
|
<br />
|
|
|
|
**After:**
|
|
|
|

|