create-react-app react+antd-mobi
1.在码云上新建仓库CRADemo
2.复制下载链接,在本地git clone下载下来CRADemo
3.使用create-react-app 脚手架创建项目crademo
4.将用脚手架建的crademo下的项目文件复制到CRADemo仓库下,删除crademo文件
5.将项目用vs code打开,(可以启动项目运行了yarn start)
6.添加antd-mobile依赖(yarn add antd-mobile --save)

7.添加react-app-rewired依赖(yarn add react-app-rewired,babel-plugin-import --dev)并做以下修改

8.此时运行项目yarn start,会报错:The "injectBabelPlugin" helper has been deprecated as of v2.0. You can use customize-cra plugins in replacement - https://github.com/arackaf/customize-cra#available-plugins
【是说react-scripts 升级到 2.1.2 以后破坏了 react-app-rewired,react-app-rewired的新版本删除所有方法injectBabelPlugin,这些方法被移动到一个名为'customize-cra'的新包中了】
解决方案参考以下:
https://blog.csdn.net/zoepriselife316/article/details/88063171
https://github.com/timarney/react-app-rewired/issues/348

yarn add less less-loader
yarn add customize-cra

然后再运行yarn start,即可正常运行,antd-mobile已经引入可以正常使用

9.执行 yarn build 打包,项目中会出现build文件以及其中内容,可以直接在项目根目录执行 http-server开启服务, 然后即可打开浏览器访问build好的项目了
