• Stars
    star
    965
  • Rank 47,414 (Top 1.0 %)
  • Language
    JavaScript
  • Created over 8 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The dva command line utility.

dva-cli

NPM version NPM downloads

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.

License

MIT