diff --git a/README-zh_CN.md b/README-zh_CN.md index 453cc10bc8..57e764012d 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -56,7 +56,7 @@ ReactDOM.render(, mountNode); import 'antd/dist/antd.css'; // or 'antd/dist/antd.less' ``` -按需加载可通过此写法 `import DatePicker from 'antd/lib/date-picker'` 或使用插件 [babel-plugin-import](https://github.com/ant-design/babel-plugin-import)。 +按需加载可通过此写法 `import DatePicker from 'antd/lib/date-picker'` 或使用 Babel 插件 [babel-plugin-import](https://github.com/ant-design/babel-plugin-import),或使用 TypeScript 插件 [ts-import-plugin](https://github.com/Brooooooklyn/ts-import-plugin)。 ## TypeScript diff --git a/README.md b/README.md index 0dfead0d00..4707045fbf 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,19 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less' > - set `allowSyntheticDefaultImports` to prevent `error TS1192: Module 'react' has no default export`. > - Don't use @types/antd, antd provide a built-in ts definition already. +#### Use [ts-import-plugin](https://github.com/Brooooooklyn/ts-import-plugin) with modularized antd + + ```js + { + loader: "ts-loader", // or awesome-typescript-loader + options { + getCustomTransformers: () => ({ + before: [ tsImportPluginFactory({ libraryName: "antd", style: "css" }) ] + }) + } + } + ``` + ## Internationalization See [i18n](http://ant.design/docs/react/i18n).