Skip to content

docs: clarify env files merge behavior #4902

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

Merged
merged 1 commit into from
Mar 28, 2025
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion website/docs/en/guide/advanced/env-vars.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ For example, set the env mode as `test`:
npx rsbuild dev --env-mode test
```

Rsbuild will then read the following files in sequence:
Rsbuild will read these files in the following order and merge their contents. If the same environment variable is defined in multiple files, values from files loaded later will override those from files loaded earlier:

- .env
- .env.local
Expand Down
2 changes: 1 addition & 1 deletion website/docs/zh/guide/advanced/env-vars.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ Rsbuild 也支持读取 `.env.[mode]` 和 `.env.[mode].local` 文件,你可以
npx rsbuild dev --env-mode test
```

Rsbuild 会依次读取以下文件
Rsbuild 会按照以下顺序读取这些文件,并合并它们的内容。如果存在同名环境变量,后读取的文件将会覆盖先读取的文件中的值

- .env
- .env.local
Expand Down
Loading