Skip to content

Commit

Permalink
fix: check default in CJS build (#193)
Browse files Browse the repository at this point in the history
Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com>
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
  • Loading branch information
posva and antfu committed Aug 25, 2022
1 parent 36d27ef commit 1147a81
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/index.iife.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
return app
}
VueDemi.createApp = createApp
}
}
// Vue 2.6.x
else if (Vue.version.slice(0, 2) === '2.') {
if (VueCompositionAPI) {
Expand Down
9 changes: 6 additions & 3 deletions lib/v2.7/index.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
var Vue = require('vue')
var VueModule = require('vue')

// get the real Vue https://github.com/vueuse/vue-demi/issues/192
var Vue = VueModule.default || VueModule

exports.Vue = Vue
exports.Vue2 = Vue
Expand Down Expand Up @@ -47,6 +50,6 @@ exports.createApp = function (rootComponent, rootProps) {
return app
}

Object.keys(Vue).forEach(function (key) {
exports[key] = Vue[key]
Object.keys(VueModule).forEach(function (key) {
exports[key] = VueModule[key]
})

0 comments on commit 1147a81

Please sign in to comment.