summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Bjorn Lu <bjornlu.dev@gmail.com> 2023-11-22 11:17:21 +0800
committerGravatar GitHub <noreply@github.com> 2023-11-22 11:17:21 +0800
commit0fe3a7ed5d7bb1a9fce1623e84ba14104b51223c (patch)
tree60a14f6b1e549bfdf80c8340a670867873310c50
parentabf601233f8188d118a8cb063c777478d8d9f1a3 (diff)
downloadastro-0fe3a7ed5d7bb1a9fce1623e84ba14104b51223c.tar.gz
astro-0fe3a7ed5d7bb1a9fce1623e84ba14104b51223c.tar.zst
astro-0fe3a7ed5d7bb1a9fce1623e84ba14104b51223c.zip
Remove vendored Vite importMeta.d.ts (#9149)
-rw-r--r--.changeset/short-deers-whisper.md5
-rw-r--r--packages/astro/client.d.ts2
-rw-r--r--packages/astro/import-meta.d.ts30
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;
-}