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

Add sub-package info to environment-variables.mdx #4406

Merged
merged 4 commits into from
Apr 3, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/pages/repo/docs/handbook/environment-variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,23 @@ We're actively looking forward to improving the developer experience and ergonom
}
```

## Accessing root .env from sub-packages
mehulkar marked this conversation as resolved.
Show resolved Hide resolved

1. Place all of your variables into the root of your monorepo as a `.env` file.

2. Install `dotenv-cli` into a sub-packge.
mehulkar marked this conversation as resolved.
Show resolved Hide resolved

```json
{
"scripts": {
+. "dev": "dotenv -e ../../.env start-server"
}
"devDependencies": {
+ "dotenv-cli": "latest"
},
}
```

## With global `turbo`

If you're using `turbo` globally, you'll also need to install `dotenv-cli` globally so you can put `dotenv --` in front of the `turbo` command in your terminal.