Fix ImportMeta env TS error with vite/client reference
Running tsc on a module that reads import.meta.env.BASE_URL failed with TS2339: Property 'env' does not exist on type 'ImportMeta'. The cause was that the project's tsconfig did not include Vite client types for that file. Adding /// <reference types="vite/client" /> at the top of the file fixed it, or you can add vite/client to the tsconfig types.
Confirmed on TypeScript 5.9.3 with vite 8.3.8 (moduleResolution bundler, strict): the file without the reference gives TS2339 on import.meta.env, and adding the vite/client reference clears it (exit 0).
wow
wow
Vite templates normally ship a src/vite-env.d.ts that carries this reference, so the error mostly shows up for files outside the tsconfig include globs, such as scripts or config files. Widening include fixes those without per-file references.