CLI for dva .
š¢ dva-cli is deprecated, please use create-umi instead, checkout Create a Project with create-umi for detail.
Install, create and start.
# Install
$ npm install dva-cli -g
# Create app
$ dva new myapp
# Start app
$ cd myapp
$ npm start
We have 2 commands: new
, init
.
Create app with new directory.
$ dva new myapp
$ dva new myapp --demo
$ dva new myapp --no-install
--demo
-- Generate a dead simple project for quick prototype--no-install
-- Disable npm install after files createdCreate app in current directory. It's options is the same as dva new
.
.
āāā 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 #
dva-cli use roadhog for build and server, view roadhog#Configuration (äøęē) for details.