Skip to content

Commit 1147a81

Browse files
posvaantfu
andauthored
fix: check default in CJS build (#193)
Co-authored-by: Eduardo San Martin Morote <[email protected]> Co-authored-by: Anthony Fu <[email protected]>
1 parent 36d27ef commit 1147a81

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

lib/index.iife.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
5858
return app
5959
}
6060
VueDemi.createApp = createApp
61-
}
61+
}
6262
// Vue 2.6.x
6363
else if (Vue.version.slice(0, 2) === '2.') {
6464
if (VueCompositionAPI) {

lib/v2.7/index.cjs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
var Vue = require('vue')
1+
var VueModule = require('vue')
2+
3+
// get the real Vue https://github.com/vueuse/vue-demi/issues/192
4+
var Vue = VueModule.default || VueModule
25

36
exports.Vue = Vue
47
exports.Vue2 = Vue
@@ -47,6 +50,6 @@ exports.createApp = function (rootComponent, rootProps) {
4750
return app
4851
}
4952

50-
Object.keys(Vue).forEach(function (key) {
51-
exports[key] = Vue[key]
53+
Object.keys(VueModule).forEach(function (key) {
54+
exports[key] = VueModule[key]
5255
})

0 commit comments

Comments
 (0)