Skip to content

commands

Max Hill edited this page Aug 7, 2016 · 2 revisions

Build Commands

All build commands are executed via NPM Scripts.

npm run dev

Runs npm run webpack& npm run icons:watch in paralell. See Webpack command & Icons command for more details.

npm run webpack

Starts a Node.js local development server. See API Proxying During Development for more details.

  • Webpack + vue-loader for single file Vue components.
  • State preserving hot-reload
  • State preserving compilation error overlay
  • Lint-on-save with ESLint
  • Source maps

npm run icons

Minifies and sprites svg files in src/assets/images/icons. You may use the commnd npm run icons:watch to watch the directory for changes and re run the script on change.

  • Combines svg files in src/assets/images/icons
  • Minifes combined svg
  • Outputs src/assets/images/icons.svg

npm run build

Build assets for production. See Integrating with Backend Framework for more details.

  • JavaScript minified with UglifyJS.
  • HTML minified with html-minifier.
  • CSS across all components extracted into a single file and minified with cssnano.
  • All static assets compiled with version hashes for efficient long-term caching, and a production index.html is auto-generated with proper URLs to these generated assets.
  • Also see deployment notes.

npm run unit

Run unit tests in PhantomJS with Karma. See Unit Testing for more details.

  • Supports ES2015 in test files.
  • Supports all webpack loaders.
  • Easy mock injection.

npm run e2e

Run end-to-end tests with Nightwatch. See End-to-end Testing for more details.

  • Run tests in multiple browsers in parallel.
  • Works with one command out of the box:
    • Selenium and chromedriver dependencies automatically handled.
    • Automatically spawns the Selenium server.

npm run generate:view

Generate a new view boilerplate file. You will still need to register the view in the src/routes.js.

  • File boilerplate added by default.
  • File not created if already exists.

npm run generate:component

Generate a new component boilerplate file. You can see example of how to use a component in a view if you look in src/views/Home.vue

  • File boilerplate added by default.
  • File not created if already exists.

npm run generate:test

Generate a new test file hooked up with the test helper and component you want to test.

  • Test boilerplate added by default.
  • Test not created if already exists.
Clone this wiki locally