快速建立React apps

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

如今只须要2分钟,快速搭建环境:react

npm install -g creat-react-app

安装完成后,建立工程webpack

create-react-app 项目名

完成 ~web

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

 

备注:bash

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

 

若是没法使用creat-react-app命令,则须要babel

在.bashrc or ~/.zshrc添加
export PATH=$PATH:./node_modules/.bin
相关文章
相关标签/搜索