[Vuejs]-Include other js in webpack vs Vuejs

0👍

You are using es6 modules in your project. And to use any module inside another modules you need to first import it.

Add this line on top of your ./nqt.js

import Vue from 'vue';

Now if you want the vm defined in ./nqt.js to be used inside other modules, you need to export it here like this.
var vm = new Vue();
export default vm;

And then import it inside ./main.js

import vm from `./nqt.js`

In order to get how it works take a look at http://2ality.com/2014/09/es6-modules-final.html

Leave a comment