github evanw/esbuild v0.12.9

latest releases: v0.23.1, v0.23.0, v0.22.0...
3 years ago
  • Allow this with --define (#1361)

    You can now override the default value of top-level this with the --define feature. Top-level this defaults to being undefined in ECMAScript modules and exports in CommonJS modules. For example:

    // Original code
    ((obj) => {
      ...
    })(this);
    
    // Output with "--define:this=window"
    ((obj) => {
      ...
    })(window);

    Note that overriding what top-level this is will likely break code that uses it correctly. So this new feature is only useful in certain cases.

  • Fix CSS minification issue with !important and duplicate declarations (#1372)

    Previously CSS with duplicate declarations for the same property where the first one was marked with !important was sometimes minified incorrectly. For example:

    .selector {
      padding: 10px !important;
      padding: 0;
    }

    This was incorrectly minified as .selector{padding:0}. The bug affected three properties: padding, margin, and border-radius. With this release, this code will now be minified as .selector{padding:10px!important;padding:0} instead which means there is no longer a difference between minified and non-minified code in this case.

Don't miss a new esbuild release

NewReleases is sending notifications on new releases.