[Bug]: missing typeof optimizations
Author: nstepienCreated Sep 9, 2026Updated Sep 12, 2026
Labelsp3: nice to have / edge casescope: output sizescope: minifier
Reproduction link or steps
What is expected?
Rolldown could optimize more typeof patterns:
- "symbol" type, as well as well-known symbols
- various const objects references
- function references
typeof Number.NaNis optimized, but not other number constants- should support for the
unknowntype be removed? - invalid typeof checks on properties should always resolve to a boolean and tree-shake unreachable code
What is actually happening?
Rolldown does not optimize the patterns listed above. Please check the repro for specific examples.
System Info
System:
OS: Windows 11 10.0.26200
CPU: (32) x64 AMD Ryzen 9 9950X3D 16-Core Processor
Memory: 36.84 GB / 63.58 GB
Binaries:
Node: 26.8.1 - C:\Program Files\nodejs\node.EXE
npm: 12.0.2 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 153.0.8010.37
Edge: Chromium (152.0.4191.53)
Firefox: 155.0.1 - C:\Program Files\Mozilla Firefox\firefox.exeAny additional comments?
No response
Source: rolldown/rolldown