react环境搭建

react-webpack文件夹是开发目录,在此目录下执行命令,假设你已经正确安装了 nodejs

一:参照教程搭建环境 https://github.com/newtriks/generator-react-webpack
以下模式请用 超级管理员来运行
npm install -g yo //安装 yeoman (可选)
npm install -g generator-react-webpack  //安装生成器 (可选)
npm install //在项目文件根目录下安装依赖(重要)


二:开发模式
1,npm start
2,自动打开浏览器查看运行效果
3,修改代码并等待浏览器自动刷新

三:发布模式
1,npm run dist
2,node minserver.js
3,手动打开浏览器访问 localhost:3000/index.html
4.如果要发布到其它服务器,拷贝dist就可以了

四:测试模式
1,npm run test

五:参考
http://reactjs.cn/   //react中文文档
http://react-guide.github.io/react-router-cn/         //react-router 中文文档
http://ant.design/     // 阿里专为后台管理系统制作的react组件
原文地址:https://www.cnblogs.com/zxyun/p/5609457.html