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(config): add envDir option #3407

Merged
merged 5 commits into from
May 28, 2021
Merged

Conversation

GavinRay97
Copy link
Contributor

@GavinRay97 GavinRay97 commented May 13, 2021

Close #2113

Fork of #2123 with reviewer-requested changes, branched from latest master
CC @aleclarson

@Shinigami92 Shinigami92 added the p2-nice-to-have Not breaking anything but nice to have (priority) label May 13, 2021
@Shinigami92
Copy link
Member

question: Is this a breaking change? Do we need all to change our files from .env to env/.env after this feat gets merged?

@Shinigami92 Shinigami92 self-requested a review May 13, 2021 14:30
@aleclarson
Copy link
Member

It's not a breaking change. See here:

const envDir = config.envDir
  ? normalizePath(path.resolve(resolvedRoot, config.envDir))
  : resolvedRoot

Copy link
Member

@Shinigami92 Shinigami92 left a comment

Choose a reason for hiding this comment

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

If I see correctly, we now have no test/playground for the default case anymore
You may consider to copy the env playground and test it specifically

aleclarson
aleclarson previously approved these changes May 13, 2021
Copy link
Member

@Shinigami92 Shinigami92 left a comment

Choose a reason for hiding this comment

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

@aleclarson
Copy link
Member

@Shinigami92 I reverted the change to playground/env. I think we can merge this without its own playground, since the feature is simple enough that a regression is unlikely.

@Shinigami92
Copy link
Member

@Shinigami92 I reverted the change to playground/env. I think we can merge this without its own playground, since the feature is simple enough that a regression is unlikely.

Okay, just spend me a 🍺 somedays if there is a regression in the future 😃

@aleclarson
Copy link
Member

@Shinigami92 Deal! Just need your review approval and LGTM :)

@aleclarson aleclarson changed the title feat(config): allow user custom .env files directory (take 2) feat(config): add envDir option May 28, 2021
@aleclarson aleclarson merged commit 472ba5d into vitejs:main May 28, 2021
ygj6 pushed a commit to ygj6/vite that referenced this pull request Jun 1, 2021
Co-authored-by: Alec Larson <1925840+aleclarson@users.noreply.github.com>
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.

Configuration .env file read path not found in document
3 participants