Create React App 配置指南
https://github.com/goblin-laboratory/cra
使用 react-app-rewired 配置 Create React App 指南
- 多页应用
- antd 按需加载
- less module
$ git clone https://github.com/goblin-laboratory/cra.git
$ cd cra
$ yarn install
$ yarn start # 访问 http://localhost:3000
$ yarn global add create-react-app@next
yarn global v1.5.1
warning ..\package.json: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "[email protected]" with binaries:
- create-react-app
Done in 8.20s.
create-react-app v2 --scripts-version [email protected]
- 添加依赖
yarn add react-app-rewired@next --dev
- 根据 react-app-rewired 教程更改配置
yarn babel-plugin-import react-app-rewire-less-modules webpack-bundle-analyzer --dev
- babel-plugin-import : antd 按需加载
- react-app-rewire-less-modules : less 支持与 less module
- webpack-bundle-analyzer : build 统计工具
- eslint-config-alloy : eslint 模板
- 修改create-react-app支持多入口
- Add more entry points
- react-app-rewired
- 在 create-react-app 中使用 antd
- 以react-script重构antd-pro
URIError: Failed to decode param '/%PUBLIC_URL%/favicon.ico'
at decodeURIComponent (<anonymous>)
at decode_param (D:\github\cra\node_modules\express\lib\router\layer.js:172:12)
at Layer.match (D:\github\cra\node_modules\express\lib\router\layer.js:123:27)
at matchLayer (D:\github\cra\node_modules\express\lib\router\index.js:574:18)
at next (D:\github\cra\node_modules\express\lib\router\index.js:220:15)
at expressInit (D:\github\cra\node_modules\express\lib\middleware\init.js:40:5)
at Layer.handle [as handle_request] (D:\github\cra\node_modules\express\lib\router\layer.js:95:5)
at trim_prefix (D:\github\cra\node_modules\express\lib\router\index.js:317:13)
at D:\github\cra\node_modules\express\lib\router\index.js:284:7
at Function.process_params (D:\github\cra\node_modules\express\lib\router\index.js:335:12)
我们非常欢迎你的贡献,你可以通过以下方式和我们一起共建 😃:
- 通过 Issue 报告 bug 或进行咨询。
- 提交 Pull Request 。
cra is MIT licensed.