Introduction
nva is scaffold toolset which offer flexible configuration base on webpack,it support development purely frontend project(html+css+js) and isomorphic project(node+react/vue)
- interactive project scaffolding in many kinds of fundamental project template
- define mock data in js or json to satisfy requirements
- out-of-box support Babel, Typescript, Sass, Less, Stylus
- built-in support unit test and end-to-end test
you can also find Desktop Application named NVA Client
Install
Prerequisites: Node.js (>=6.x, LTS preferred), npm version 3+ and Git
npm install nva -g
Quick Start
- generate project
nva init <project name>
pull the template that you specified in question,generate project in ./<project name>
,you can also specified git repo to take place
nva init <project name> -r [github repo]
The shorthand repo notation is passed to download-git-repo so you can also use things like bitbucket:username/repo for a Bitbucket repo and username/repo#branch for tags or branches
- start to develop
nva dev
nva dev --silent // ignore update checks
nva dev -p <port>
nva dev --client-port <client port> // specified client port for ssr project
start develop server that hot-module-replacement(HMR) enabled,feel free get into your own business
- build project
nva build
nva build --silent // ignore update checks
build project to dist,prepare for deploy
Supported Template
frontend boilerplate
- multiple pages project with react + redux
- single page project with react + redux + react-router
- multiple pages project with vue + vuex
- single page project with vue + vuex + vue-router
isomorphic boilerplate
koa@2+react or koa@2+vue,server side render
- multiple pages project with react + redux + koa@2
- single page project with react + redux + react-router + koa@2
- multiple pages project with vue + vuex + koa@2
- single page project with vue + vuex + vue-router + koa@2
More Cli
nva mod
nva mod foo
// or add mod which copied from existed module
nva mod foo -t bar
// delete existed module
nva mod foo -d
add module directory in source path, if spa
is false
it will add build entry in bundle.json
nva gen
nva gen --input tpl/foo --output dist
render all templates in tpl/foo
and output files in dist
, tpl/foo
directory should contain meta.js
which defined some template variables and all templates live in tpl/foo/template