快速创建React apps

前端之家收集整理的这篇文章主要介绍了快速创建React apps前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

可能你在入门的时候,需要装各种npm包,例如:browser webpack react react-dom babel等等。

现在只需要2分钟,快速搭建环境:

  1. npm install -g creat-react-app

安装完成后,创建工程

  1. create-react-app 项目名

完成 ~

切换到demo目录下,执行npm start。启动web server

备注:

  1. * npm start: Starts the development server.
  2. * npm run build: Bundles the app into static files for production.
  3. * npm run eject: Removes this tool. If you do this,you cant go back!

如果无法使用creat-react-app命令,则需要

  1. 在.bashrc or ~/.zshrc添加
  2. export PATH=$PATH:./node_modules/.bin

猜你在找的React相关文章