Skip to content

Commit

Permalink
fix: @vue/composition-api submodule resolution (#517)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Roe <daniel@roe.dev>
  • Loading branch information
antfu and danielroe authored Jul 21, 2021
1 parent 97deb33 commit bb76b53
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/module/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ const compositionApiModule: Module<never> = function compositionApiModule() {

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

nuxtOptions.alias['@vue/composition-api'] =
const capiEntrypoint = '@vue/composition-api/dist/vue-composition-api.esm.js'
const capiResolution =
nuxtOptions.alias['@vue/composition-api'] ||
this.nuxt.resolver.resolveModule(
'@vue/composition-api/dist/vue-composition-api.esm.js'
)
this.nuxt.resolver.resolveModule(capiEntrypoint)

nuxtOptions.alias[capiEntrypoint] = capiResolution
nuxtOptions.alias['@vue/composition-api'] = capiResolution

// Define @nuxtjs/composition-api resolution to ensure plugins register global context successfully

Expand Down

0 comments on commit bb76b53

Please sign in to comment.