-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(env): mention vite/client.d.ts #5457
Conversation
Co-authored-by: Shinigami <chrissi92@hotmail.de>
Co-authored-by: Shinigami <chrissi92@hotmail.de>
docs/guide/env-and-mode.md
Outdated
By default, Vite provides type definition for `import.meta.env` in [`vite/client.d.ts`](https://github.com/vitejs/vite/blob/main/packages/vite/client.d.ts). Make sure to reference it in your project, for instance in `src/env.d.ts` | ||
|
||
```typescript | ||
/// <reference types="vite/client" /> | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized that the docs below this change had also mentioned about env.d.ts
, which makes this part a bit out of place. I wonder if it would suffice to only add the /// <reference types="vite/client" />
in the code block below (line 69) to simplify the docs, and revert most of the text changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, that's much simpler now. I've updated the PR.
Description
Mention
compilerOptions.types
in https://vitejs.dev/guide/env-and-mode.htmlAdditional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).