From 4716b5ea0f335bd8a1d582c60e6ce7e49c6bca3e Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Fri, 13 Aug 2021 15:30:03 +0200 Subject: [PATCH] feat(nuxt): resolve in mono repos --- nuxt/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nuxt/index.js b/nuxt/index.js index 2cd5875ed7..7c9a4400d9 100644 --- a/nuxt/index.js +++ b/nuxt/index.js @@ -14,9 +14,12 @@ export default function NuxtPiniaModule(options) { fileName: 'pinia.js', }) - this.options.build.transpile = this.options.build.transpile || [] + // Define pinia resolution to ensure plugins register global context successfully + this.options.alias['pinia'] = + this.options.alias['pinia'] || this.nuxt.resolver.resolveModule('pinia') // transpile pinia if @vue/composition-api is transpiled because we must use the same instance + this.options.build.transpile = this.options.build.transpile || [] if ( !this.options.dev && !this.options.build.transpile.includes('pinia') &&