vite-env.d.ts/// <reference types="vite/client" />) that instructs the TypeScript compiler to include Vite's ambient type declarations. This provides type information for Vite-specific features like import.meta.env (environment variables), asset imports (importing .svg, .png files as URLs), and the Vite HotModuleReplacement API. Created during the react-scripts→Vite migration, replacing the previous react-app-env.d.ts that served the same purpose for Create React App.This is a TypeScript ambient declaration file — it doesn't produce any JavaScript output. Its sole purpose is to pull in Vite's type definitions so that the IDE and type checker recognize Vite-specific global types. The file is listed in tsconfig.json's include array alongside the old react-app-env.d.ts path (which was later replaced).
When the project migrated from Create React App to Vite (commit bf988bc6d), this file was created as the Vite counterpart to the CRA react-app-env.d.ts. The tsconfig.json was updated from src/react-app-env.d.ts to src/vite-env.d.ts in the include list. Both files existed briefly during the transition.
| Commit | What changed |
|---|---|
bf988bc6d | Created the file with the /// <reference types="vite/client" /> directive as part of the comprehensive react-scripts→Vite migration. This replaced the CRA-specific react-app-env.d.ts to provide type definitions for the Vite build environment. |