Skip to content

[Bug]: {} has different behaviour than undefined for optimization.inlineConst #9244

@sadan4

Description

@sadan4

Reproduction link or steps

https://repl.rolldown.rs/#eNptUstO7DAM/RUrG+Cq6uheLiyKWLFiwR9kQdo600DqVIk7PKr+O046wCAh9RHH9vGxjxdlVbMoRz2+1pzymVTzbVeqy+Y4hcjwB0yC1kSwMYygVb0To35KWt1o0tQFSsFj7cP+PDvkrXJ4PlxIhIChajjOuFYqBu/78EK1ZFm3P6n9i+cHiwV6tI7wrrhh3dicfaadZSr4WkIl0My+/L8SzhdNAI6mmRvYIOsR2dTlqoLdDnhAsM5jgoQeO8Ye2rdy287MgUAeNN0AbNoMNnnDNsSxkZm0MbwkjFpV2SM8MLoRiY1voFQG6IaZnu9L5QczNZAnUqLX8g0Tu9G9G3aBvnIc+a2DJKxnUSc31Gey3WBoj8LOJeAAj8v6CIZ6CK3QOCD0zlqMwgBaHMzBhTme1Jq5zOFYJTdhxNQKRdQSATA6cvbtlKam9ULkFBUn0z2bPcoOBJFu0+/H3aZcgdeqxwmFOnUuw0vVjLQBbYv0CXG0tuSjlnm7pAfZvluB+vvv8v/l1bVsnlol/SBxIgImVusHTE70nQ==

  1. open the link
  2. go to rolldown.config.ts
  3. change optimization.inlineConst to {}
  4. notice different behaviour

What is expected?

I would expect that {} has the same behaviour as undefined

What is actually happening?

if optimization.inlineConst != null and optimization.inlineConst.mode == null then it is defaulted to "all" instead of "smart" like documented(https://rolldown.rs/reference/InputOptions.optimization#default) .

System Info

https://repl.rolldown.rs/

Any additional comments?

If this is intended behaviour, then the docs should be updated as this behaviour is confusing. eg: a user changing the number of passes unknowingly changes the mode.

Metadata

Metadata

Labels

No labels
No labels

Type

Priority

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions