[Vuejs]-How can i add 'vue.js' to webpack's bundle.js

1๐Ÿ‘

โœ…

Vue 2.2 now per default uses ES6 modules, but despite it was pointed in the other answer as wrong, you can still use CommonJS if you want, so is not wrong do require('vue'), however, is recommended to switch to the new syntax.

You can do:

var Vue = require('vue').default;

or

import Vue from 'vue';

The last works without the default property, because the new ES6 syntax does this automatically for you.

๐Ÿ‘คEdmundo Santos

-1๐Ÿ‘

You should replace

var Vue = require('vue')

by

import Vue from 'vue'
๐Ÿ‘คCorentin PRUNE

Leave a comment