From 257a8a6d36c365672c2daae87d0eeaea75168e0c Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Thu, 14 Oct 2021 12:16:06 +0200 Subject: [PATCH] chore: add notes [skip ci] --- packages/nuxt/src/index.ts | 4 ---- packages/nuxt/templates/plugin.js | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/nuxt/src/index.ts b/packages/nuxt/src/index.ts index 10f5836b..eecf8054 100644 --- a/packages/nuxt/src/index.ts +++ b/packages/nuxt/src/index.ts @@ -34,10 +34,6 @@ const module = defineNuxtModule({ addPlugin({ src: resolve(__dirname, '../templates/plugin.js') }) - // Define pinia resolution to ensure plugins register global context successfully - // TODO: needed with @nuxt/bridge but not without it... - // nuxt.options.alias['pinia'] = nuxt.options.alias['pinia'] || resolveModule('pinia/index.mjs') - // transpile pinia if @vue/composition-api is transpiled because we must use the same instance if ( !nuxt.options.dev && diff --git a/packages/nuxt/templates/plugin.js b/packages/nuxt/templates/plugin.js index 156bfadd..427eb387 100644 --- a/packages/nuxt/templates/plugin.js +++ b/packages/nuxt/templates/plugin.js @@ -29,6 +29,7 @@ const PiniaNuxtPlugin = (context, inject) => { setActivePinia(pinia) // add access to `$nuxt` + // TODO: adapt to Nuxt 3 with a definePlugin pinia._p.push(({ store }) => { // make it non enumerable so it avoids any serialization and devtools Object.defineProperty(store, '$nuxt', { value: context }) -- 2.47.3