create-react-app

一 简介

1用途

create-react-app是React官方的快速上手脚手架。

2优缺点及对比

优点

零配置命令行工具,能够帮你自动创建基于Webpack+ES6的最简易的React项目模板,有助于初学者快速上手实践。

缺点

因为配置都已经弄好了,不允许自由去配置,所以如果想自己自由的搭建和配置webpck项目,还是建议自己从零到一去搭建,不要用现成脚手架,需要快速起一个项目的时候可以用,所有东西都现成,效率比较高。

二 基本概念

三 使用及案例

npm install -g create-react-app

sudo create-react-app my-app

cd my-app/

npm start

命令:

npm start

Starts the development server.

npm run build

Bundles the app into static files for production.

npm test

Starts the test runner.

npm run eject

Removes this tool and copies build dependencies, configuration files

and scripts into the app directory. If you do this, you can’t go back!

四 资源

1官网

2文档

3源码

https://github.com/facebookincubator/create-react-app

4教程

官方教程:

https://github.com/facebookincubator/create-react-app

https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md

其他教程:

官方 React 快速上手脚手架 create-react-app

http://www.imooc.com/article/17382

results matching ""

    No results matching ""