Skip to content

Commit 6f4046e

Browse files
authored
docs: clarify .env/.env.local convention (#2158)
1 parent 40dbcde commit 6f4046e

3 files changed

Lines changed: 15 additions & 8 deletions

File tree

.env

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
# Environment variables
2-
# https://vitejs.dev/guide/env-and-mode.html#env-files
3-
#
4-
# TIP: Feel free to personalize these settings in your `.env.local` file that
5-
# is not tracked by source control, giving you the liberty to tweak
6-
# settings in your local environment worry-free! Happy coding! 🚀
1+
# Shared environment defaults committed to git (no real secrets).
2+
# Put real credentials in `.env.local` (git-ignored), which overrides `.env`.
3+
# https://vite.dev/guide/env-and-mode#env-files
74

85
# Web application settings
96
APP_NAME=Acme Co.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ node_modules/
2222
*.lcov
2323

2424
# Environment variables
25+
# `.env` is committed with shared defaults/placeholders; keep secrets in `.env.local`.
2526
.env.*.local
2627
.env.local
2728

@@ -69,4 +70,3 @@ srcpack.config.ts
6970
# macOS
7071
# https://github.com/github/gitignore/blob/master/Global/macOS.gitignore
7172
.DS_Store
72-

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,17 @@ bun install
8383

8484
### 3. Configure Environment
8585

86-
Update environment variables in [`.env`](./.env) and `.env.local` files as well as Wrangler configuration in [`wrangler.jsonc`](./apps/api/wrangler.jsonc).
86+
This project follows [Vite env conventions](https://vite.dev/guide/env-and-mode#env-files):
87+
88+
- [`.env`](./.env) is committed and contains shared defaults/placeholders only (no real secrets)
89+
- `.env.local` is git-ignored and should contain your real credentials
90+
- `.env.local` values override `.env`
91+
92+
```bash
93+
cp .env .env.local # then replace placeholder values with real ones
94+
```
95+
96+
Also check [`wrangler.jsonc`](./apps/api/wrangler.jsonc) for Worker configuration and bindings.
8797

8898
### 4. Start Development
8999

0 commit comments

Comments
 (0)