From d62cc836ccd626f7081a7e73a636c7b7ded0d29d Mon Sep 17 00:00:00 2001 From: Johann Schopplich Date: Mon, 18 Mar 2024 17:39:44 +0100 Subject: [PATCH] perf: use `import.meta.server` over `process.server` --- src/module.ts | 2 +- src/runtime/composables/$api.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/module.ts b/src/module.ts index 066e325..7f5be3a 100644 --- a/src/module.ts +++ b/src/module.ts @@ -85,7 +85,7 @@ export default defineNuxtModule({ name: 'nuxt-api-party', configKey: 'apiParty', compatibility: { - nuxt: '^3', + nuxt: '^3.7', }, }, defaults: { diff --git a/src/runtime/composables/$api.ts b/src/runtime/composables/$api.ts index 4d5b070..71218f8 100644 --- a/src/runtime/composables/$api.ts +++ b/src/runtime/composables/$api.ts @@ -134,7 +134,7 @@ export function _$api( const request = (client ? clientFetcher() : serverFetcher()) .then((response) => { - if (process.server || cache) + if (import.meta.server || cache) nuxt.payload.data[_key] = response promiseMap.delete(_key) return response