Skip to content

Commit

Permalink
fix: opt in to import.meta.* properties
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Mar 25, 2024
1 parent 7ba4558 commit 26ef213
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/docs/ssr/index.md
Expand Up @@ -92,7 +92,7 @@ const pinia = createPinia()
const app = createApp(App)
app.use(pinia)

// `isClient` depends on the environment, e.g. on Nuxt it's `process.client`
// `isClient` depends on the environment, e.g. on Nuxt it's `import.meta.client`
if (isClient) {
pinia.state.value = JSON.parse(window.__pinia)
}
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/playground/app.vue
Expand Up @@ -8,7 +8,7 @@ useSomeStoreStore()
// await useAsyncData('counter', () => counter.asyncIncrement().then(() => true))
if (process.server) {
if (import.meta.server) {
counter.increment()
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/src/runtime/plugin.vue2.ts
Expand Up @@ -16,7 +16,7 @@ export default (context: any, provide: any) => {
Object.defineProperty(store, '$nuxt', { value: context })
})

if (process.server) {
if (import.meta.server) {
context.beforeNuxtRender((ctx: any) => {
ctx.nuxtState.pinia = pinia.state.value
})
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/src/runtime/plugin.vue3.ts
Expand Up @@ -9,7 +9,7 @@ const plugin: Plugin<{ pinia: Pinia }> = defineNuxtPlugin({
nuxtApp.vueApp.use(pinia)
setActivePinia(pinia)

if (process.server) {
if (import.meta.server) {
nuxtApp.payload.pinia = pinia.state.value
} else if (nuxtApp.payload && nuxtApp.payload.pinia) {
pinia.state.value = nuxtApp.payload.pinia
Expand Down

0 comments on commit 26ef213

Please sign in to comment.