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

feat: allow custom vite env prefix #4676

Merged
merged 10 commits into from Aug 27, 2021
Merged

feat: allow custom vite env prefix #4676

merged 10 commits into from Aug 27, 2021

Conversation

hyf0
Copy link
Contributor

@hyf0 hyf0 commented Aug 21, 2021

close #4194

Description

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 self-requested a review August 21, 2021 10:13
@Shinigami92 Shinigami92 added the p2-nice-to-have Not breaking anything but nice to have (priority) label Aug 21, 2021
@hyf0 hyf0 marked this pull request as ready for review August 21, 2021 15:07
Shinigami92
Shinigami92 previously approved these changes Aug 21, 2021
@@ -333,6 +333,18 @@ export default defineConfig(async ({ command, mode }) => {

See [here](/guide/env-and-mode#env-files) for more about environment files.

### envVariblePrefix
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure whether envVariblePrefix is a good name? I'm open to a better name.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My preference would be to use envPrefix. We can leave the final call to be discussed with the rest of the team though this week.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have strong opinion here, both names are okay

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestions. I'm changing to envPrefix for now and waiting for the final call.

@patak-dev patak-dev changed the title feat(vite): allow custom vite env prefix feat: allow custom vite env prefix Aug 27, 2021
@patak-dev patak-dev merged commit dfdb9cc into vitejs:main Aug 27, 2021
@patak-dev
Copy link
Member

ping @benmccann, just so you are aware of this new option in case it is useful for SvelteKit

@benmccann
Copy link
Collaborator

Thanks! This is nice. I like the idea of using something like PUBLIC or CLIENT since it always seemed a bit weird to me to put VITE in user code

@VojtechVitek
Copy link

This is great. Thank you!

Could we mention that envPrefix is available from Vite v2.5.2 in the documentation?

@patak-dev
Copy link
Member

Could we mention that envPrefix is available from Vite v2.5.2 in the documentation?

We are not including the version when a feature has been added at this point in the documentation. IMO, since the project is young we can assume most of the people will be on latest fairly quickly. How to add this info to the docs and when should be discussed for all options at one point. The best way to see when features were added is to follow the changelog

aleclarson pushed a commit to aleclarson/vite that referenced this pull request Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow custom vite env prefix
6 participants