Count: {{ counter.$state.count }}
- -Count: {{ counter.$state.count }}
+ +{{ skipHydrateState }}
+ diff --git a/packages/nuxt/playground/stores/with-skip-hydrate.ts b/packages/nuxt/playground/stores/with-skip-hydrate.ts new file mode 100644 index 0000000000..3cbbc31bc2 --- /dev/null +++ b/packages/nuxt/playground/stores/with-skip-hydrate.ts @@ -0,0 +1,16 @@ +import { skipHydrate } from 'pinia' + +export const useWithSkipHydrateStore = defineStore('with-skip-hydrate', () => { + const skipped = skipHydrate( + ref({ + text: 'I should not be serialized or hydrated', + }) + ) + return { skipped } +}) + +if (import.meta.hot) { + import.meta.hot.accept( + acceptHMRUpdate(useWithSkipHydrateStore, import.meta.hot) + ) +} diff --git a/packages/nuxt/playground/tsconfig.json b/packages/nuxt/playground/tsconfig.json new file mode 100644 index 0000000000..4b34df1571 --- /dev/null +++ b/packages/nuxt/playground/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "./.nuxt/tsconfig.json" +} diff --git a/packages/nuxt/src/module.ts b/packages/nuxt/src/module.ts index b528bad4f6..08148ad940 100644 --- a/packages/nuxt/src/module.ts +++ b/packages/nuxt/src/module.ts @@ -11,6 +11,7 @@ import { addImportsDir, } from '@nuxt/kit' import type { NuxtModule } from '@nuxt/schema' +import { fileURLToPath } from 'node:url' export interface ModuleOptions { /** @@ -44,7 +45,9 @@ const module: NuxtModule