0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

Remove vendored Vite importMeta.d.ts (#9149)

This commit is contained in:
Bjorn Lu 2023-11-22 11:17:21 +08:00 committed by GitHub
parent abf601233f
commit 0fe3a7ed5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 31 deletions

View file

@ -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

View file

@ -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 {

View file

@ -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;
}