Vue CLI need Node 4++ (6.x prefered) with NPM 3++
Installation
npm install -g vue-cli
yarn global add vue-cli
Usage
Generatin a Vue.js project
vue init <template-name> <project-name>
you can see the
vue list
Current available templates include:
- webpack - A full-featured Webpack + vue-loader setup with hot reload, linting, testing & css extraction.
- webpack-simple - A simple Webpack + vue-loader setup for quick prototyping.
- browserify - A full-featured Browserify + vueify setup with hot-reload, linting & unit testing.
- browserify-simple - A simple Browserify + vueify setup for quick prototyping.
- simple - The simplest possible Vue setup in a single HTML file
Start Developement
To get started:
cd <dest-dir-name>
npm install
npm run dev
current version: 2.8.1 - Date: Jan. 2017
Build
Creating a build : the artifacts will be stored in the dist/ directory.
npm run build
Build targets and environment, the mapping used can be found in angular-cli.json :
npm run build --prod
Build component without manually create a Vue instance for it:
vue build <Component.vue>
Watch mode (as development mode but does not add hot-reloading support):
vue build index.js --watch
Need help:
vue build -h
Test
Running unit tests
npm run test
Running end-to-end tests
npm run e2e
Linting code
npm run lint
Help
vue help