Skip to content

fix: expand dotenv names containing null - #21898

Closed
OskarEichler wants to merge 1 commit into
webpack:mainfrom
OskarEichler:fix/dotenv-null-substring-expansion
Closed

fix: expand dotenv names containing null#21898
OskarEichler wants to merge 1 commit into
webpack:mainfrom
OskarEichler:fix/dotenv-null-substring-expansion

Conversation

@OskarEichler

Copy link
Copy Markdown
Contributor

Summary

Dotenv expansion split expressions with a null delimiter when no operator existed, so a variable name containing lowercase null was broken into unrelated fragments. Operator-free expressions now remain whole before lookup.

What kind of change does this PR introduce?

fix

Did you add tests for your changes?

Yes. The real dotenv config case expands a reference to WEBPACK_null_VALUE. The focused integration run passes 112 tests, and all lint, generated-output, type, format, spelling, changeset, diff, and final-newline checks pass.

Does this PR introduce a breaking change?

No. Valid variable names now expand correctly.

If relevant, did you update the documentation?

A patch changeset documents the expansion correction. No public documentation change is required.

Use of AI

Significant AI assistance was used to audit dotenv expansion and draft the fix and regression coverage. I reviewed the final diff and verification results.

@changeset-bot

changeset-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e619c55

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
webpack Patch

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

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 37 minutes.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: abbc763c-cc8b-4b15-a7c3-967729e06729

📥 Commits

Reviewing files that changed from the base of the PR and between 5352fd8 and e619c55.

📒 Files selected for processing (4)
  • .changeset/020-dotenv-null-key-expansion.md
  • lib/DotenvPlugin.js
  • test/configCases/plugins/import-meta-env/.env.test
  • test/configCases/plugins/import-meta-env/index.js

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Sponsor
SponsoredKunjungi sekarang
Promo