Skip to content

Commit

Permalink
Ignore only local env files in Vite templates
Browse files Browse the repository at this point in the history
In Vite `.env` files work a bit differently, where `.env` itself is
intended to be public, and `.env.local` is the one that should be
ignored by Git. But a Vite project can have more `.env` files, like
`.env.development`, which is used only in development mode, and
overrides values in `.env`, then you can have `.env.development.local`
as well and so on.

https://vitejs.dev/guide/env-and-mode.html#env-files
  • Loading branch information
silvenon committed Mar 16, 2024
1 parent 8f6e21f commit a62f3be
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion templates/vite-cloudflare/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ node_modules

/.cache
/build
.env
.env*.local

.wrangler
2 changes: 1 addition & 1 deletion templates/vite-express/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ node_modules

/.cache
/build
.env
.env*.local
2 changes: 1 addition & 1 deletion templates/vite/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ node_modules

/.cache
/build
.env
.env*.local

0 comments on commit a62f3be

Please sign in to comment.