]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
fix(nuxt): point to the correct dist file
authorEduardo San Martin Morote <posva13@gmail.com>
Thu, 14 Oct 2021 09:57:19 +0000 (11:57 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Thu, 14 Oct 2021 09:57:19 +0000 (11:57 +0200)
packages/nuxt/src/index.ts

index 01a5e1d8539c20a2bf70f75c8e20eefec4217da6..5c4eebe5575eaf70cd1ba2238596e27b1b93094a 100644 (file)
@@ -28,6 +28,10 @@ const module = defineNuxtModule<PiniaNuxtOptions>({
       nuxt.options.features.store = false
     }
 
+    // make sure we use the mjs for pinia so node doesn't complain about using a module js with an extension that is js
+    // but doesn't have the type: module in its packages.json file
+    nuxt.options.alias.pinia = 'pinia/pinia.mjs'
+
     addPlugin({ src: resolve(__dirname, '../templates/plugin.js') })
 
     // Define pinia resolution to ensure plugins register global context successfully