Skip to content

Commit

Permalink
fix(nuxt): fully resolve pinia path (#1537)
Browse files Browse the repository at this point in the history
* fix(nuxt): fully resolve pinia path

* fix: include module url

Co-authored-by: pooya parsa <pyapar@gmail.com>

* style: lint

Co-authored-by: pooya parsa <pyapar@gmail.com>
  • Loading branch information
danielroe and pi0 committed Aug 10, 2022
1 parent a06df7d commit 9c3b521
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/nuxt/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
isNuxt2,
addAutoImport,
createResolver,
resolveModule,
} from '@nuxt/kit'

export interface ModuleOptions {
Expand Down Expand Up @@ -60,7 +61,9 @@ export default defineNuxtModule<ModuleOptions>({
nuxt.options.build.transpile.push(resolver.resolve('./runtime'))

// Make sure we use the mjs build for pinia
nuxt.options.alias.pinia = 'pinia/dist/pinia.mjs'
nuxt.options.alias.pinia = resolveModule('pinia/dist/pinia.mjs', {
paths: [nuxt.options.rootDir, import.meta.url],
})

// Add runtime plugin
if (isNuxt2()) {
Expand Down

0 comments on commit 9c3b521

Please sign in to comment.