React|项目构建

一、官方推荐 Create React App

Create React App只提供react开发环境,毕竟原始。诸如路由、仓库、api等等需要自己安装配置
常用命令:

  • 普通构建项目:npx create-react-app my-app 或者 yarn create-react-app my-app (npx是npm 5.2+或者更高版本自带的,npm是node package manage,只要你安装了nodeJS就自带了npm)
  • 构建TypeScript项目:npx create-react-app my-app --template typescript 或者 yarn create react-app my-app --template typescript

诸如代理、sass支持等等其他详细设置,去官网,上面有更详细的解决方案以及描述:Create React App 官网(英文)Create React App 中文文档(有点卡)

二、企业开发 Umi

阿里旗下蚂蚁开发的一款企业级React应用的框架,比如配置、路由、测试、部署等等都有了开箱即用的解决方案,相对于Create React App多了很多已经完善的解决方案
创建:yarn create @umijs/umi-app或者npx @umijs/create-umi-app
更多查看官网:Umi官网

posted @ 2020-07-09 20:07  Sebastian·S·Pan  阅读(130)  评论(0编辑  收藏  举报