From: Eduardo San Martin Morote Date: Fri, 20 Aug 2021 15:23:46 +0000 (+0200) Subject: docs: migration v1 nuxt X-Git-Tag: @pinia/nuxt@0.0.2~42 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1358afaaa47dba07ebee7fc2f7c90c81b0eeed26;p=thirdparty%2Fvuejs%2Fpinia.git docs: migration v1 nuxt --- diff --git a/packages/docs/cookbook/migration-v1-v2.md b/packages/docs/cookbook/migration-v1-v2.md index 0a00472b..ea234d37 100644 --- a/packages/docs/cookbook/migration-v1-v2.md +++ b/packages/docs/cookbook/migration-v1-v2.md @@ -71,3 +71,39 @@ yarn add @vue/composition-api@latest ## Devtools Pinia v2 no longer hijacks Vue Devtools v5, it requires Vue Devtools v6. Find the download link on the [Vue Devtools documentation](https://devtools.vuejs.org/guide/installation.html#chrome) for the **beta channel** of the extension. + +## Nuxt + +If you are using Nuxt, pinia has now it's dedicated Nuxt package 🎉. Install it with: + +```shell +npm i @pinia/nuxt +# or with yarn +yarn add @pinia/nuxt +``` + +Also make sure to **update your `@nuxtjs/composition-api` package**. + +Then adapt your `nuxt.config.js` and your `tsconfig.json` if you are using TypeScript: + +```diff + // nuxt.config.js + module.exports { + buildModules: [ + '@nuxtjs/composition-api/module', +- 'pinia/nuxt', ++ '@pinia/nuxt', + ], + } +``` + +```diff + // tsconfig.json + { + "types": [ + // ... +- "pinia/nuxt/types" ++ "@pinia/nuxt" + ] + } +```