The spec does not clarify whether #__PURE__
applies to tagged templates.
Tool |
result |
playground |
terser |
❌ |
|
Rollup |
❌ |
link |
esbuild |
❌ |
link |
SWC |
✅ |
link |
Oxc |
❌ |
link |
✅: removes the expression
❌: does not remove the expression
Currently, the behaviors are aligned expect for SWC.
I think we should clarify that #__PURE__
does not apply for tagged templates.