Skip to content

[rush] Add support for .env files. #5155

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

iclanton
Copy link
Member

Summary

Adds support for loading env vars via <repo root>/.env and ~/.rush-user/.env files.

How it was tested

Tested by setting the new variable introduced in #5154 in a .env file.

Impacted documentation

This should be documented.

@iclanton iclanton moved this from Needs triage to In Progress in Bug Triage Mar 24, 2025
@@ -0,0 +1,10 @@
{
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does rushx support this feature as well?

@@ -0,0 +1,10 @@
{
"changes": [
{
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is <repo root>/.env intended to be committed to Git? Or is it for the user only? We should document the intended usage.

"changes": [
{
"packageName": "@microsoft/rush",
"comment": "Add support for setting environment variables via `<repo-root>/.env` and `~/.rush-user/.env` files.",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Impacted documentation

This should be documented.

@iclanton could you add a note to the top of https://rushjs.io/pages/configs/environment_vars/ ? That is probably the most discoverable place

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

3 participants