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>
This commit is contained in:
Jocker
2020-04-27 15:42:45 +08:00
committed by GitHub
parent 57d36f5b68
commit e12b560329
2 changed files with 8 additions and 12 deletions

View File

@@ -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,

View File

@@ -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,