Skip to content
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

Merged
merged 5 commits into from
Oct 29, 2021
Merged

docs(env): mention vite/client.d.ts #5457

merged 5 commits into from
Oct 29, 2021

Conversation

simon04
Copy link
Contributor

@simon04 simon04 commented Oct 28, 2021

Description

Mention compilerOptions.types in https://vitejs.dev/guide/env-and-mode.html

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@Shinigami92 Shinigami92 added documentation Improvements or additions to documentation p1-chore Doesn't change code behavior (priority) labels Oct 28, 2021
simon04 and others added 2 commits October 28, 2021 19:33
Co-authored-by: Shinigami <chrissi92@hotmail.de>
Co-authored-by: Shinigami <chrissi92@hotmail.de>
Comment on lines 58 to 62
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" />
```
Copy link
Member

@bluwy bluwy Oct 29, 2021

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.

Copy link
Contributor Author

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.

@simon04 simon04 changed the title docs(env): mention compilerOptions.types docs(env): mention vite/client.d.ts Oct 29, 2021
@patak-dev patak-dev merged commit 012ab61 into vitejs:main Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation p1-chore Doesn't change code behavior (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants