Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
fix: alias @nuxtjs/composition-api to esm library
Browse files Browse the repository at this point in the history
closes #488
  • Loading branch information
danielroe committed May 28, 2021
1 parent 417edbe commit 5d30325
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/module/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,19 @@ 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'] = this.nuxt.resolver.resolveModule(
'@vue/composition-api/dist/vue-composition-api.esm.js'
)
nuxtOptions.alias['@vue/composition-api'] =
nuxtOptions.alias['@vue/composition-api'] ||
this.nuxt.resolver.resolveModule(
'@vue/composition-api/dist/vue-composition-api.esm.js'
)

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

nuxtOptions.alias['@nuxtjs/composition-api'] =
nuxtOptions.alias['@nuxtjs/composition-api'] ||
this.nuxt.resolver
.resolveModule('@nuxtjs/composition-api')
.replace('.js', '.mjs')

// Register the Vue Composition API for webpack

Expand Down

0 comments on commit 5d30325

Please sign in to comment.