Repository navigation
fix: preserve empty process environment variables in DotenvPlugin - #22785
shuaiyafei wants to merge 1 commit into
Conversation
|
🦋 Changeset detectedLatest commit: b91f4da The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Change: Bug fix Merge Risk: ⚪ Minimal · up to
|
Summary
Preserve empty process environment variables when no
.envdefault exists, including withdotenv.dir: false. Check forundefinedinstead of using a truthiness check.Actual build output for an environment variable set to
"":process.env.WEBPACK_DOTENV_EMPTY_PROCESS_ONLYundefined""import.meta.env.WEBPACK_DOTENV_EMPTY_PROCESS_ONLYundefined""What kind of change does this PR introduce?
fix
Did you add tests for your changes?
Yes.
test/configCases/plugins/dotenv-empty-process-envcovers empty variables, file overrides, and nonempty values with file loading enabled and disabled.All 48 dotenv tests pass across
ConfigTestCasesandConfigCacheTestCases. The regression fails in both suites before the fix.yarn lintpasses, including generated files, types, formatting, and spellcheck.Does this PR introduce a breaking change?
No.
If relevant, what needs to be documented once your changes are merged or what have you already documented?
n/a
Use of AI
Codex helped reproduce the bug, prepare the patch and regression tests, and run the checks.
Summary by CodeRabbit
.envfiles. Nonempty process values continue to take precedence.