dva-cli
January 13, 2019 ยท View on GitHub
CLI for dva .
๐ข dva-cli is deprecated, please use create-umi instead, checkout Create a Project with create-umi for detail.
Getting Started
Install, create and start.
# Install
$ npm install dva-cli -g
# Create app
$ dva new myapp
# Start app
$ cd myapp
$ npm start
Commands
We have 2 commands: new, init.
dva new [options]
Create app with new directory.
Usage Examples
$ dva new myapp
$ dva new myapp --demo
$ dva new myapp --no-install
options
--demo-- Generate a dead simple project for quick prototype--no-install-- Disable npm install after files created
dva init [options]
Create app in current directory. It's options is the same as dva new.
Generated File Tree
.
โโโ src # Source directory
โโโ assets # Store images, icons, ...
โโโ components # UI components
โโโ index.css # CSS for entry file
โโโ index.html # HTML for entry file
โโโ index.js # Enry file
โโโ models # Dva models
โโโ router.js # Router configuration
โโโ routes # Route components
โโโ services # Used for communicate with server
โโโ utils # Utils
โโโ request.js # A util wrapped dva/fetch
โโโ .editorconfig #
โโโ .eslintrc # Eslint config
โโโ .gitignore #
โโโ .roadhogrc # Roadhog config
โโโ package.json #
Configuration
dva-cli use roadhog for build and server, view roadhog#Configuration (ไธญๆ็) for details.