Skip to content

Fix additionally inserted whitespace in var(--foo,) and env(--foo,)#1142

Merged
devongovett merged 4 commits intoparcel-bundler:masterfrom
RobinMalfait:fix/issue-1141
Jan 28, 2026
Merged

Fix additionally inserted whitespace in var(--foo,) and env(--foo,)#1142
devongovett merged 4 commits intoparcel-bundler:masterfrom
RobinMalfait:fix/issue-1141

Conversation

@RobinMalfait
Copy link
Contributor

@RobinMalfait RobinMalfait commented Jan 28, 2026

This PR fixes an issue where var(--foo,) with a fallback and env(--foo,) with a fallback injected an extra whitespace character after the comma.

This always happened even if there was already some whitespace. So an input like:

var(--foo, )

Resulted in:

var(--foo,  )

It's using a similar fix as implemented here: 32f1f52#diff-2c849c2fb4295c48ca4d58d85ff61f2d31178ccd99b9190bd7714928a7d8d820
image

Instead of calling .delim() we check for whitespace being present and manually inject the , and whitespace if necessary.

Test plan

  • Added tests for both var() and env() that ensures that no additional whitespace is added after the comma.
  • All other tests still pass.

Fixes: #1141

@devongovett devongovett merged commit aa2ed1e into parcel-bundler:master Jan 28, 2026
3 checks passed
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.

Additional whitespace being inserted in var(--foo,) and env(--foo,)

2 participants