Browse Source

docs: 📖 update use-with-create-react-app (#23661)

* Update use-with-create-react-app.zh-CN.md

官网上babel-import-plugin引用的教程有误,会误导新手
https://github.com/ant-design/ant-design/issues/23660

* Update use-with-create-react-app.zh-CN.md

* Update use-with-create-react-app.en-US.md

Co-authored-by: 偏右 <afc163@gmail.com>
pull/23664/head
Jocker 5 years ago
committed by GitHub
parent
commit
e12b560329
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      docs/react/use-with-create-react-app.en-US.md
  2. 10
      docs/react/use-with-create-react-app.zh-CN.md

10
docs/react/use-with-create-react-app.en-US.md

@ -104,10 +104,10 @@ $ yarn add react-app-rewired customize-cra
/* package.json */
"scripts": {
- "start": "react-scripts start",
+ "start": "react-app-rewired start",
- "build": "react-scripts build",
+ "build": "react-app-rewired build",
- "test": "react-scripts test",
+ "start": "react-app-rewired start",
+ "build": "react-app-rewired build",
+ "test": "react-app-rewired test",
}
```
@ -139,8 +139,7 @@ $ yarn add babel-plugin-import
- return config;
- };
+ module.exports = override(
+ fixBabelImports('import', {
+ libraryName: 'antd',
+ fixBabelImports('antd', {
+ libraryDirectory: 'es',
+ style: 'css',
+ }),
@ -184,8 +183,7 @@ $ yarn add less less-loader
+ const { override, fixBabelImports, addLessLoader } = require('customize-cra');
module.exports = override(
fixBabelImports('import', {
libraryName: 'antd',
fixBabelImports('antd', {
libraryDirectory: 'es',
- style: 'css',
+ style: true,

10
docs/react/use-with-create-react-app.zh-CN.md

@ -104,10 +104,10 @@ $ yarn add react-app-rewired customize-cra
/* package.json */
"scripts": {
- "start": "react-scripts start",
+ "start": "react-app-rewired start",
- "build": "react-scripts build",
+ "build": "react-app-rewired build",
- "test": "react-scripts test",
+ "start": "react-app-rewired start",
+ "build": "react-app-rewired build",
+ "test": "react-app-rewired test",
}
```
@ -139,8 +139,7 @@ $ yarn add babel-plugin-import
- return config;
- };
+ module.exports = override(
+ fixBabelImports('import', {
+ libraryName: 'antd',
+ fixBabelImports('antd', {
+ libraryDirectory: 'es',
+ style: 'css',
+ }),
@ -184,8 +183,7 @@ $ yarn add less less-loader
+ const { override, fixBabelImports, addLessLoader } = require('customize-cra');
module.exports = override(
fixBabelImports('import', {
libraryName: 'antd',
fixBabelImports('antd', {
libraryDirectory: 'es',
- style: 'css',
+ style: true,

Loading…
Cancel
Save