Skip to content

Commit

Permalink
docs: add boilerplate samples
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Mar 10, 2017
1 parent 23415a0 commit f2f786d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions docs/react/use-with-create-react-app.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,12 @@ loaders: [

We use `modifyVars` option of [less-loader](https://github.com/webpack/less-loader#less-options) here, you can see a green button rendered on the page after reboot start server.

---
## Source code and other boilerplates

Finally, we use antd with create-react-app successfully, you can learn these practice for your own webpack workflow too, and find more webpack config in the [atool-build](https://github.com/ant-tool/atool-build/blob/master/src/getWebpackCommonConfig.js). (For instance, add [moment noParse](https://github.com/ant-tool/atool-build/blob/e4bd2959689b6a95cb5c1c854a5db8c98676bdb3/src/getWebpackCommonConfig.js#L90) to avoid loading all language files)

Source code about this article:https://github.com/ant-design/create-react-app-antd
There are a lot of great boilerplates in React community. You may encounter some problems when import antd in them, there are some source code samples including create-react-app in this article.

- [create-react-app-antd](https://github.com/ant-design/create-react-app-antd)
- [react-boilerplate/react-boilerplate](https://github.com/ant-design/react-boilerplate)
- [kriasoft/react-starter-kit](https://github.com/ant-design/react-starter-kit)
8 changes: 6 additions & 2 deletions docs/react/use-with-create-react-app.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,12 @@ loaders: [

修改后重启 `yarn start`,如果看到一个绿色的按钮就说明配置成功了。

---
## 源码和其他脚手架

以上是在 create-react-app 中使用 antd 的相关实践,你也可以借鉴此文的做法在自己的 webpack 工作流中使用 antd,更多 webpack 配置可参考 [atool-build](https://github.com/ant-tool/atool-build/blob/master/src/getWebpackCommonConfig.js)。(例如加入 [moment noParse](https://github.com/ant-tool/atool-build/blob/e4bd2959689b6a95cb5c1c854a5db8c98676bdb3/src/getWebpackCommonConfig.js#L90) 避免加载所有语言文件)

本例所有源码可见:https://github.com/ant-design/create-react-app-antd
React 生态圈中还有很多优秀的脚手架,使用它们并引入 antd 时,你可能会遇到一些问题,下面是一些著名脚手架使用 antd 的范例,包括本文中的 create-react-app 示例源码。

- [react-boilerplate/react-boilerplate](https://github.com/ant-design/react-boilerplate)
- [kriasoft/react-starter-kit](https://github.com/ant-design/react-starter-kit)
- [create-react-app-antd](https://github.com/ant-design/create-react-app-antd)

1 comment on commit f2f786d

@afc163
Copy link
Member Author

@afc163 afc163 commented on f2f786d Mar 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.