release notes
release notes
Published 1/18/2023
PatchSafe upgradeFix incorrect CSS minification for certain rules (#2838)
Certain rules such as [@media](https://github.com/media) could previously be minified incorrectly. Due to a typo in the duplicate rule checker, two known @-rules that share the same hash code were incorrectly considered to be equal. This problem was made worse by the rule hashing code considering two unknown declarations (such as CSS variables) to have the same hash code, which also isn't optimal from a performance perspective. Both of these issues have been fixed:
/* Original input */
[@media](https://github.com/media) (prefers-color-scheme: dark) { body { --VAR-1: [#000](https://github.com/evanw/esbuild/pull/000); } }
[@media](https://github.com/media) (prefers-color-scheme: dark) { body { --VAR-2: [#000](https://github.com/evanw/esbuild/pull/000); } }
/* Old output (with --minify) */
[@media](https://github.com/media) (prefers-color-scheme: dark){body{--VAR-2: [#000](https://github.com/evanw/esbuild/pull/000)}}
/* New output (with --minify) */
[@media](https://github.com/media) (prefers-color-scheme: dark){body{--VAR-1: [#000](https://github.com/evanw/esbuild/pull/000)}}[@media](https://github.com/media) (prefers-color-scheme: dark){body{--VAR-2: [#000](https://github.com/evanw/esbuild/pull/000)}}
release notes
Published 1/18/2023
PatchSafe upgradeFix incorrect CSS minification for certain rules (#2838)
Certain rules such as [@media](https://github.com/media) could previously be minified incorrectly. Due to a typo in the duplicate rule checker, two known @-rules that share the same hash code were incorrectly considered to be equal. This problem was made worse by the rule hashing code considering two unknown declarations (such as CSS variables) to have the same hash code, which also isn't optimal from a performance perspective. Both of these issues have been fixed:
/* Original input */
[@media](https://github.com/media) (prefers-color-scheme: dark) { body { --VAR-1: [#000](https://github.com/evanw/esbuild/pull/000); } }
[@media](https://github.com/media) (prefers-color-scheme: dark) { body { --VAR-2: [#000](https://github.com/evanw/esbuild/pull/000); } }
/* Old output (with --minify) */
[@media](https://github.com/media) (prefers-color-scheme: dark){body{--VAR-2: [#000](https://github.com/evanw/esbuild/pull/000)}}
/* New output (with --minify) */
[@media](https://github.com/media) (prefers-color-scheme: dark){body{--VAR-1: [#000](https://github.com/evanw/esbuild/pull/000)}}[@media](https://github.com/media) (prefers-color-scheme: dark){body{--VAR-2: [#000](https://github.com/evanw/esbuild/pull/000)}}
An extremely fast bundler for the web