vue.runtime.global.min.js is not in a format that works with webpack using externals
Version
3.2.30
Reproduction link
Steps to reproduce
Webpack, listing vue as an external library (loaded separately in the browser), produces a bundle that checks the module for __esModule
(which is true on the Vue global build, as well as VueRouter, but not Vuex), but when this value is true it then expects default
to be defined on the module, which is undefined.
What is expected?
import Vue from 'vue';
should work. Vue.default
in the browser should return Vue, or Vue.__esModule
should not be defined.
What is actually happening?
Vue.__esModule
is true but Vue.default
is undefined, so import Vue from 'vue';
returns undefined in my client code.
I am trying to load as much as possible from CDN; so I don't want to import Vue directly into my bundle. The current build forces me to write const Vue = window.Vue;
.