File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change 77 isNuxtMajorVersion ,
88 addImports ,
99 createResolver ,
10- resolveModule ,
1110 addImportsDir ,
1211} from '@nuxt/kit'
1312import type { NuxtModule } from '@nuxt/schema'
@@ -63,15 +62,11 @@ const module: NuxtModule<ModuleOptions> = defineNuxtModule<ModuleOptions>({
6362 // Transpile runtime
6463 nuxt . options . build . transpile . push ( resolve ( runtimeDir ) )
6564
66- // This alias broke in Nuxt 3 so only add it in Nuxt 2
67- if ( isNuxtMajorVersion ( 2 , nuxt ) ) {
68- // Make sure we use the mjs build for pinia
69- nuxt . options . alias . pinia =
70- nuxt . options . alias . pinia ||
71- // FIXME: remove this deprecated call. Ensure it works in Nuxt 2 to 3
72- resolveModule ( 'pinia/dist/pinia.mjs' , {
73- paths : [ nuxt . options . rootDir , import . meta. url ] ,
74- } )
65+ // avoids having multiple copies of pinia
66+ nuxt . options . vite . optimizeDeps ??= { }
67+ nuxt . options . vite . optimizeDeps . exclude ??= [ ]
68+ if ( ! nuxt . options . vite . optimizeDeps . exclude . includes ( 'pinia' ) ) {
69+ nuxt . options . vite . optimizeDeps . exclude . push ( 'pinia' )
7570 }
7671
7772 nuxt . hook ( 'prepare:types' , ( { references } ) => {
You can’t perform that action at this time.
0 commit comments