这是indexloc提供的服务,不要输入任何密码
Skip to content
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"
},
}
```