一、React脚手架的使用 ------ 2020-03-21
作者:
自己写了自己看 | 来源:发表于
2020-03-21 10:06 被阅读0次
1、全局安装 create-react-app
npm i -g create-react-app //全局安装脚手架
create-react-app xxx // 基于脚手架创建项目
yarn start // 启动项目
yanr build // 生成项目
yarn eject // 暴露webpack配置项
/**
* 可能会出现提示(安装包中无src目录):
* A template was not provided. This is likely because you're using
* an outdated version of create-react
*
* 解决办法:卸载掉全局安装的 create-react-app
* npm uninstall -g create-react-app
* 使用下面提供的第二种安装方式:
*/
2、使用npx安装:
npx create-react-app xxx // 基于脚手架创建项目
yarn start // 启动项目
yanr build // 生成项目
yarn eject // 暴露webpack配置项
本文标题:一、React脚手架的使用 ------ 2020-03-21
本文链接:https://www.haomeiwen.com/subject/lytyyhtx.html
网友评论