码迷,mamicode.com
首页 > 移动开发 > 详细

[React] Set up React apps with zero configuration

时间:2016-08-02 06:31:43      阅读:277      评论:0      收藏:0      [点我收藏+]

标签:

The React team has an official Command Line Interface (CLI) for building React projects called "Create React App"; in this lesson, we show how to use this tool to quickly set up new projects using the create-react-app {project-name}command. We then use the npm scripts that are provided: npm start to develop, npm run build to ship, and npm run eject to opt out of the abstracted tooling.

The benefits of this tool are:
- It‘s officially maintained by the React team; this means best practices out of the box
- Zero config, one dependency
- Config is abstracted so React team can make improvements under the hood and you get the new goodness for free
- Clean command line output for errors
- You can "eject" at any time if needed

 

Install:

npm install -g create-react-app

 

Create a new app:

create-react-app react-start

 

Remove react-scripts:

npm run eject

This will remove the react-script and back to normal.

[React] Set up React apps with zero configuration

标签:

原文地址:http://www.cnblogs.com/Answer1215/p/5727846.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!