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

fix: @vue/composition-api submodule resolution #517

Merged
merged 3 commits into from
Jul 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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