From: Eduardo San Martin Morote Date: Thu, 21 Oct 2021 15:19:52 +0000 (+0200) Subject: fix: should work with nuxt X-Git-Tag: @pinia/nuxt@0.0.9~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=03159a440de0eb2b17c3c3bd30dc64223fe90648;p=thirdparty%2Fvuejs%2Fpinia.git fix: should work with nuxt --- diff --git a/packages/nuxt/package.json b/packages/nuxt/package.json index dede5ebe..604dcb1e 100644 --- a/packages/nuxt/package.json +++ b/packages/nuxt/package.json @@ -29,6 +29,7 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, + "./dist/templates/*": "./dist/templates/*", "./templates/*": "./dist/templates/*" }, "main": "./dist/index.js", @@ -38,10 +39,11 @@ "dist/*.js", "dist/*.mjs", "dist/*.d.ts", - "dist/templates/*.js" + "dist/templates/*.js", + "dist/templates/*.mjs" ], "scripts": { - "build": "siroc", + "build": "siroc build", "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s --commit-path . -l @pinia/nuxt -r 1" }, "dependencies": { diff --git a/packages/nuxt/src/index.ts b/packages/nuxt/src/index.ts index 030de996..a6fd55a8 100644 --- a/packages/nuxt/src/index.ts +++ b/packages/nuxt/src/index.ts @@ -32,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: require.resolve('./templates/plugin') }) + addPlugin({ src: require.resolve('./templates/plugin.mjs') }) // transpile pinia for nuxt 2 and nuxt bridge if (isVue2 && !nuxt.options.build.transpile.includes('pinia')) {