create-react-app 的老版本/新版本模板

cra 新版本有一些不兼容的生态,如 craco 这种情况,我们需要cra@4.0.3这种版本。
更新于: 2022-06-08 12:06:30
项目主页: https://github.com/afeiship/cra-templates

安装

# install cra
npm i -g react-create-app

# use the template<cra-template-[typescript4|js4]>
create-react-app your_project --template @jswork/js4
create-react-app your_project --template @jswork/typescript4

# use the template<cra-template-[typescript5]>
create-react-app your_project --template @jswork/typescript5

# from local
create-react-app your_project --template file:YOUR_LOCAL_PATH/cra-template-typescript4

已经有项目了

create-react-app . --template @jswork/js4

说明

  1. 到官方网站 https://github.com/facebook/create-react-app.git
  2. 切换到tag: git checkout v4.0.3
  3. 提取对应的 template
  4. 与官方的区别在于,添加了 craco 的基本配置(这个工具,目前只能用于v4)