From e12b56032987ff9969019166a8b3a45c70bf279a Mon Sep 17 00:00:00 2001 From: Jocker <123888666zbb@gmail.com> Date: Mon, 27 Apr 2020 15:42:45 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=F0=9F=93=96=20update=20use-with-create?= =?UTF-8?q?-react-app=20(#23661)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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: 偏右 --- docs/react/use-with-create-react-app.en-US.md | 10 ++++------ docs/react/use-with-create-react-app.zh-CN.md | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/docs/react/use-with-create-react-app.en-US.md b/docs/react/use-with-create-react-app.en-US.md index 96575dab77..002792de96 100644 --- a/docs/react/use-with-create-react-app.en-US.md +++ b/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, diff --git a/docs/react/use-with-create-react-app.zh-CN.md b/docs/react/use-with-create-react-app.zh-CN.md index 125e48bd9f..00dc8adeee 100644 --- a/docs/react/use-with-create-react-app.zh-CN.md +++ b/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,