From: Eduardo San Martin Morote Date: Thu, 21 Oct 2021 12:53:29 +0000 (+0200) Subject: refactor: still trying to get this working... X-Git-Tag: @pinia/nuxt@0.0.9~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=23285ca3411b35385606f53581f9b1dbaba97ad9;p=thirdparty%2Fvuejs%2Fpinia.git refactor: still trying to get this working... --- diff --git a/packages/nuxt/package.json b/packages/nuxt/package.json index 942d4b8d..45f836e4 100644 --- a/packages/nuxt/package.json +++ b/packages/nuxt/package.json @@ -29,7 +29,7 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, - "./src/templates/*": "./dist/templates/*.js" + "./templates/*": "./dist/templates/*.js" }, "main": "./dist/index.js", "module": "./dist/index.mjs", diff --git a/packages/nuxt/src/index.ts b/packages/nuxt/src/index.ts index e68dc44e..030de996 100644 --- a/packages/nuxt/src/index.ts +++ b/packages/nuxt/src/index.ts @@ -1,7 +1,6 @@ /** * @module @pinia/nuxt */ -import { resolve } from 'upath' import { addPlugin, defineNuxtModule } from '@nuxt/kit' import { isVue2 } from 'vue-demi' import type { Pinia } from 'pinia' @@ -33,7 +32,7 @@ const module = defineNuxtModule({ // but doesn't have the type: module in its packages.json file nuxt.options.alias.pinia = 'pinia/index.mjs' - addPlugin({ src: resolve(__dirname, './templates/plugin.js') }) + addPlugin({ src: require.resolve('./templates/plugin') }) // transpile pinia for nuxt 2 and nuxt bridge if (isVue2 && !nuxt.options.build.transpile.includes('pinia')) {