esbuild 0.14.29
-
Fix a minification bug with a double-nested
ifinside a label followed byelse(#2139)This fixes a minification bug that affects the edge case where
ifis followed byelseand theifcontains a label that contains a nestedif. Normally esbuild's AST printer automatically wraps the body of a single-statementifin braces to avoid the "dangling else"if/elseambiguity common to C-like languages (where theelseaccidentally becomes associated with the innerifinstead of the outerif). However, I was missing automatic wrapping of label statements, which did not have test coverage because they are a rarely-used feature. This release fixes the bug:// Original code if (a) b: { if (c) break b } else if (d) e() // Old output (with --minify) if(a)e:if(c)break e;else d&&e(); // New output (with --minify) if(a){e:if(c)break e}else d&&e(); -
Fix edge case regarding
baseUrlandpathsintsconfig.json(#2119)In
tsconfig.json, TypeScript forbids non-relative values insidepathsifbaseUrlis not present, and esbuild does too. However, TypeScript checked this after the entiretsconfig.jsonhierarchy was parsed while esbuild incorrectly checked this immediately when parsing the file containing thepathsmap. This caused incorrect warnings to be generated fortsconfig.jsonfiles that specify abaseUrlvalue and that inherit apathsvalue from anextendsclause. Now esbuild will only check for non-relativepathsvalues after the entire hierarchy has been parsed to avoid generating incorrect warnings. -
Better handle errors where the esbuild binary executable is corrupted or missing (#2129)
If the esbuild binary executable is corrupted or missing, previously there was one situation where esbuild's JavaScript API could hang instead of generating an error. This release changes esbuild's library code to generate an error instead in this case.