Skip to content

docs: recommend vite-env.ts for TypeScript env types#22535

Open
sgibler-droid wants to merge 2 commits into
vitejs:mainfrom
sgibler-droid:docs/recommend-vite-env-ts
Open

docs: recommend vite-env.ts for TypeScript env types#22535
sgibler-droid wants to merge 2 commits into
vitejs:mainfrom
sgibler-droid:docs/recommend-vite-env-ts

Conversation

@sgibler-droid
Copy link
Copy Markdown

Description

Updates the TypeScript environment type docs to recommend vite-env.ts instead of an authored vite-env.d.ts file.

This follows the discussion in #19693: user-authored source files are type-checked normally, while declaration files are easy to accidentally skip with common TypeScript settings like skipLibCheck.

Changes

  • Replaces user-facing vite-env.d.ts examples with vite-env.ts.
  • Uses declare global + export {} for module-safe global augmentation examples.
  • Updates the related triple-slash directive and shared define examples.

Fixes #19693.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recommend vite-env.ts over vite-env.d.ts

1 participant