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 all commits
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
21 changes: 21 additions & 0 deletions docs/pages/repo/docs/handbook/environment-variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,24 @@ We're actively looking forward to improving the developer experience and ergonom
## 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.

## With workspace scripts

You may prefer to make your workspaces responsible for loading environment variables. This approach is more flexible, if you don't mind the extra configuration overhead in your `package.json` scripts.

To use this strategy:

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

2. Install `dotenv-cli` in the workspace.

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