mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-09 02:49:18 +08:00
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:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user