diff options
-rw-r--r-- | .changeset/short-deers-whisper.md | 5 | ||||
-rw-r--r-- | packages/astro/client.d.ts | 2 | ||||
-rw-r--r-- | packages/astro/import-meta.d.ts | 30 |
3 files changed, 6 insertions, 31 deletions
diff --git a/.changeset/short-deers-whisper.md b/.changeset/short-deers-whisper.md new file mode 100644 index 000000000..03e0f4480 --- /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 f2af4a88c..f1cb0ff11 100644 --- a/packages/astro/client.d.ts +++ b/packages/astro/client.d.ts @@ -1,4 +1,4 @@ -/// <reference path="./import-meta.d.ts" /> +/// <reference types="vite/types/import-meta.d.ts" /> // 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 23d951cf2..000000000 --- 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 -// <https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation> - -/* 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; -} |