Skip to content

Commit

Permalink
fix: resolve to single vue instance (#525)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Jul 28, 2021
1 parent 057972c commit 33171bf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/module/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ const compositionApiModule: Module<never> = function compositionApiModule() {
nuxtOptions.build.transpile = nuxtOptions.build.transpile || []
nuxtOptions.build.transpile.push('@nuxtjs/composition-api', runtimeDir)

// Define vue resolution to prevent VCA being registered to the wrong Vue instance

nuxtOptions.alias.vue =
nuxtOptions.alias.vue ||
(nuxtOptions.dev
? this.nuxt.resolver.resolveModule('vue/dist/vue.common.dev.js')
: this.nuxt.resolver.resolveModule('vue/dist/vue.runtime.esm.js'))

// Define @vue/composition-api resolution to prevent using different versions of @vue/composition-api

const capiEntrypoint = '@vue/composition-api/dist/vue-composition-api.esm.js'
Expand Down

0 comments on commit 33171bf

Please sign in to comment.