Skip to content

v0.14.29

Compare
Choose a tag to compare
@github-actions github-actions released this 30 Mar 02:12
  • Fix a minification bug with a double-nested if inside a label followed by else (#2139)

    This fixes a minification bug that affects the edge case where if is followed by else and the if contains a label that contains a nested if. Normally esbuild's AST printer automatically wraps the body of a single-statement if in braces to avoid the "dangling else" if/else ambiguity common to C-like languages (where the else accidentally becomes associated with the inner if instead of the outer if). 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 baseUrl and paths in tsconfig.json (#2119)

    In tsconfig.json, TypeScript forbids non-relative values inside paths if baseUrl is not present, and esbuild does too. However, TypeScript checked this after the entire tsconfig.json hierarchy was parsed while esbuild incorrectly checked this immediately when parsing the file containing the paths map. This caused incorrect warnings to be generated for tsconfig.json files that specify a baseUrl value and that inherit a paths value from an extends clause. Now esbuild will only check for non-relative paths values 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.