fix(nuxt): deprecate process.* flags (#27089)

This commit is contained in:
Daniel Roe 2024-05-07 15:07:18 +01:00 committed by GitHub
parent 3169c5cec7
commit bff1ec237b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,20 +1,29 @@
import type { UseHeadInput } from '@unhead/vue'
import type { NuxtApp, useNuxtApp } from '../nuxt'
interface NuxtStaticBuildFlags {
browser: boolean
client: boolean
dev: boolean
server: boolean
test: boolean
}
declare global {
namespace NodeJS {
interface Process extends NuxtStaticBuildFlags {}
interface Process {
/** @deprecated Use `import.meta.browser` instead. This may be removed in Nuxt v5 or a future major version. */
browser: boolean
/** @deprecated Use `import.meta.client` instead. This may be removed in Nuxt v5 or a future major version. */
client: boolean
/** @deprecated Use `import.meta.dev` instead. This may be removed in Nuxt v5 or a future major version. */
dev: boolean
/** @deprecated Use `import.meta.server` instead. This may be removed in Nuxt v5 or a future major version. */
server: boolean
/** @deprecated Use `import.meta.test` instead. This may be removed in Nuxt v5 or a future major version. */
test: boolean
}
}
interface ImportMeta extends NuxtStaticBuildFlags {}
interface ImportMeta extends NuxtStaticBuildFlags {
browser: boolean
client: boolean
dev: boolean
server: boolean
test: boolean
}
interface Window {
__NUXT__?: Record<string, any>