From f78a78e03be417930be9bfb0566bbb1c238e8765 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 5 Aug 2018 13:35:54 +0800 Subject: [PATCH] docs: instruction about antd/es/button --- docs/react/getting-started.en-US.md | 2 ++ docs/react/getting-started.zh-CN.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/docs/react/getting-started.en-US.md b/docs/react/getting-started.en-US.md index a135d6605d..a93aaa4434 100755 --- a/docs/react/getting-started.en-US.md +++ b/docs/react/getting-started.en-US.md @@ -188,6 +188,8 @@ import Button from 'antd/lib/button'; import 'antd/lib/button/style'; // or antd/lib/button/style/css for css format file ``` +> `antd/es/button` to import es version module for tree shaking. + We strongly recommend using [babel-plugin-import](https://github.com/ant-design/babel-plugin-import), which can convert the following code to the 'antd/lib/xxx' way: ```jsx diff --git a/docs/react/getting-started.zh-CN.md b/docs/react/getting-started.zh-CN.md index 4469b57202..0f8837db61 100755 --- a/docs/react/getting-started.zh-CN.md +++ b/docs/react/getting-started.zh-CN.md @@ -188,6 +188,8 @@ import Button from 'antd/lib/button'; import 'antd/lib/button/style'; // 或者 antd/lib/button/style/css 加载 css 文件 ``` +> `antd/es/button` 可以加载 ES 版本的模块,方便进一步 Tree Shake. + 如果你使用了 babel,那么可以使用 [babel-plugin-import](https://github.com/ant-design/babel-plugin-import) 来进行按需加载,加入这个插件后。你可以仍然这么写: ```jsx