Skip to content

feat(env): add false option for envDir to disable env loading#19503

Merged
patak-cat merged 12 commits into
vitejs:mainfrom
OnlyWick:feat-supports-disable-env-loading
Mar 31, 2025
Merged

feat(env): add false option for envDir to disable env loading#19503
patak-cat merged 12 commits into
vitejs:mainfrom
OnlyWick:feat-supports-disable-env-loading

Conversation

@OnlyWick

Copy link
Copy Markdown
Contributor

Description

close #19373.

@OnlyWick

OnlyWick commented Feb 24, 2025

Copy link
Copy Markdown
Contributor Author

This will cause all .env files to not be loaded. If using dotenvx, you can access the env variables injected by dotenvx through process.env.ENV_NAME.

@sapphi-red sapphi-red added the p2-to-be-discussed Enhancement under consideration (priority) label Feb 25, 2025
@bluwy bluwy changed the title feat(vite): add false option for envDir to disable env loading feat(env): add false option for envDir to disable env loading Mar 19, 2025
@sapphi-red sapphi-red moved this from Discussing to Approved in Team Board Mar 19, 2025
Comment thread packages/vite/src/node/config.ts Outdated
Comment thread packages/vite/src/node/server/index.ts Outdated
@sapphi-red

Copy link
Copy Markdown
Member

Would you also update the docs, too?

@OnlyWick OnlyWick force-pushed the feat-supports-disable-env-loading branch from bcc3b2e to f6a587a Compare March 28, 2025 03:25
@OnlyWick OnlyWick requested a review from sapphi-red March 28, 2025 03:31
Comment thread docs/config/shared-options.md Outdated
Comment thread packages/vite/src/node/config.ts
Comment thread docs/guide/api-javascript.md Outdated
Comment thread packages/vite/src/node/config.ts Outdated
Comment thread packages/vite/src/node/config.ts Outdated
Comment thread packages/vite/src/node/server/hmr.ts Outdated
Comment thread packages/vite/src/node/config.ts
OnlyWick and others added 6 commits March 28, 2025 18:20
@OnlyWick OnlyWick requested a review from sapphi-red March 28, 2025 13:34
@sapphi-red sapphi-red added p2-nice-to-have Not breaking anything but nice to have (priority) and removed p2-to-be-discussed Enhancement under consideration (priority) labels Mar 31, 2025
@patak-cat patak-cat merged commit bca89e1 into vitejs:main Mar 31, 2025
@OnlyWick OnlyWick deleted the feat-supports-disable-env-loading branch March 31, 2025 07:50
moonlitusun pushed a commit to moonlitusun/vite that referenced this pull request May 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p2-nice-to-have Not breaking anything but nice to have (priority)

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Add envDir: false option

3 participants