Catalog
  1. 1. 详细用法
  2. 2. 推荐阅读
简述create react app的用法

详细用法

  1. 全局安装

    npm i create-react-app -g

  2. 创建应用(以下其一即可)

    • npx create-react-app my-app
    • yarn create create-react-app my-app
    • npm i create-react-app my-app
  3. 将封装在 create-react-app 中的配置全部反编译到当前项目中,使用户完全取得 webpack 文件的控制权

    npm run ejectyarn eject

    你不会想要用到这个命令的

  4. 运行测试

    npm run testyarn test

  5. 编译

    npm run buildyarn build

  6. 运行程序

    1
    2
    cd my-app
    npm/yarn start

推荐阅读

Author: Erealm
Link: http://erealmsoft.github.io/2019/09/24/react/react-create-react-app/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.

Comment