Skip to content
create react app with global command tool
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
command
template/react_demo
.gitignore
CHANGELOG.md
README.md
package.json

README.md

TR-CLI

一个全局的命令行工具用来创建一个新的项目

安装

npm install -g tr-cli

创建一个应用程序

tr-cli init

name:myapp //你的项目名字myapp

version[1.0.0]:: //版本号(默认为1.0.0)

cd my-app

项目结构

├──myapp
│├──.babelrc
│├──config
││├──path.js
││├──webpack.config.dev.js
││├──webpack.config.dll.js
││├──webpack.config.js
││├──webpack.config.prod.js
││├──webpackDevServer.config.js
│├──package.json
│├──public
││├──index.html
│├──scripts
││├──build.js
││├──node.js
││├──start.js
││├──start.pre.js
│├──src
││├──App.js
││├──common
││├──components
││├──images
││├──redux
│││├──configStore.js
│││├──reducers.js
││├──routes
│││├──index.js
││├──styles
││├──utils
││├──views
│││├──Home.js
│││├──HomeRedux.js
│││├──home.scss
│├──test
││├──index.js

运行

首先运行预打包

npm run start:pre

开发调试

npm start

运行测试

npm run test

上线打包

npm run build

配置Node环境

npm run n

其他

1、代理配置在package.json中proxy字段

2、webpack配置在/config/目录中,*.dev.js为开发环境配置,*.dll.js为预打包配置,*.prod.js为上线生产打包

You can’t perform that action at this time.