From 0fe3a7ed5d7bb1a9fce1623e84ba14104b51223c Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Wed, 22 Nov 2023 11:17:21 +0800 Subject: [PATCH] Remove vendored Vite importMeta.d.ts (#9149) --- .changeset/short-deers-whisper.md | 5 +++++ packages/astro/client.d.ts | 2 +- packages/astro/import-meta.d.ts | 30 ------------------------------ 3 files changed, 6 insertions(+), 31 deletions(-) create mode 100644 .changeset/short-deers-whisper.md delete mode 100644 packages/astro/import-meta.d.ts diff --git a/.changeset/short-deers-whisper.md b/.changeset/short-deers-whisper.md new file mode 100644 index 000000000000..03e0f4480676 --- /dev/null +++ b/.changeset/short-deers-whisper.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Removes vendored Vite's `importMeta.d.ts` file in favour of Vite 5's new `vite/types/import-meta.d.ts` export diff --git a/packages/astro/client.d.ts b/packages/astro/client.d.ts index f2af4a88c0a1..f1cb0ff1188d 100644 --- a/packages/astro/client.d.ts +++ b/packages/astro/client.d.ts @@ -1,4 +1,4 @@ -/// +/// // eslint-disable-next-line @typescript-eslint/no-namespace declare namespace App { diff --git a/packages/astro/import-meta.d.ts b/packages/astro/import-meta.d.ts deleted file mode 100644 index 23d951cf2db1..000000000000 --- a/packages/astro/import-meta.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -// File vendored from Vite itself, as a workaround to https://github.com/vitejs/vite/issues/13309 until Vite 5 comes out - -// This file is an augmentation to the built-in ImportMeta interface -// Thus cannot contain any top-level imports -// - -/* eslint-disable @typescript-eslint/consistent-type-imports */ - -interface ImportMeta { - url: string; - - readonly hot?: import('vite/types/hot').ViteHotContext; - - readonly env: ImportMetaEnv; - - glob: import('vite/types/importGlob').ImportGlobFunction; - /** - * @deprecated Use `import.meta.glob('*', { eager: true })` instead - */ - globEager: import('vite/types/importGlob').ImportGlobEagerFunction; -} - -interface ImportMetaEnv { - [key: string]: any; - BASE_URL: string; - MODE: string; - DEV: boolean; - PROD: boolean; - SSR: boolean; -}