How to do it...

Create a new directory with an empty npm project. You can use the npm init -y command or, if you have Yarn installed, you can use yarn init -y inside the directory. This command will create a new package.json inside the directory. (Refer to the note in the Developing with continuous feedback with hot reloading recipe on Yarn.)

For this npm project, we will need a couple of dependencies other than Vue: Webpack, and Babel in the form of a loader for Webpack. Oh yes, we will need the vue-loader as well for Webpack. To install them, launch the following two commands:

npm install --save vuenpm install --save-dev webpack babel-core babel-loader babel-preset-es2015 vue-loader vue-template-compiler

In the same directory, let's write ...

Get Vue.js 2 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.