esbuild 0.18.10
-
Fix a tree-shaking bug that removed side effects (#3195)
This fixes a regression in version 0.18.4 where combining
--minify-syntaxwith--keep-namescould cause expressions with side effects after a function declaration to be considered side-effect free for tree shaking purposes. The reason was because--keep-namesgenerates an expression statement containing a call to a helper function after the function declaration with a special flag that makes the function call able to be tree shaken, and then--minify-syntaxcould potentially merge that expression statement with following expressions without clearing the flag. This release fixes the bug by clearing the flag when merging expression statements together. -
Fix an incorrect warning about CSS nesting (#3197)
A warning is currently generated when transforming nested CSS to a browser that doesn't support
:is()because transformed nested CSS may need to use that feature to represent nesting. This was previously always triggered when an at-rule was encountered in a declaration context. Typically the only case you would encounter this is when using CSS nesting within a selector rule. However, there is a case where that's not true: when using a margin at-rule such as@top-leftwithin@page. This release avoids incorrectly generating a warning in this case by checking that the at-rule is within a selector rule before generating a warning.