EN · DE · RU · FR · ES

#2763: vite-env.d.ts

projectforge-webapp/src/vite-env.d.ts TypeScript Declaration File (Vite) · projectforge-webapp/src/vite-env.d.ts 1 lines · 0 code · 1 comments · 0 blank
The Vite client type declaration reference. This file contains a single TypeScript triple-slash directive (/// <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.

Architecture

Role in the Build System

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).

Migration Context

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.

Git History

CommitWhat changed
bf988bc6dCreated 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.