All Versions
Latest Version
Avg Release Cycle
22 days
Latest Release
21 days ago

Changelog History
Page 1

  • v2.9.7

    October 01, 2020
    • cmd: add JS options
    • ๐Ÿ”€ JS: remove unassigned bindings in for statement initializer when it cannot be merged with variable declaration
    • JS: use Precision option in minifying numbers
    • SVG: fix bugs in skipping foreignObject tags
  • v2.9.6

    October 01, 2020
    • ๐Ÿ›  JS: add var decl as undeclared in block scopes between the current scope and the function scope, fixes #334
    • ๐Ÿ›  JS: fix overwriting next statement in if-else => if-if conversion, fixes #335
  • v2.9.5

    September 23, 2020
    • cmd: minify input even if extension is unknown but type/mimetype is given
    • โฑ CSS: fix timeout in property with many commas
    • ๐Ÿ›  CSS: convert RGBA to transparent only if the color is fully transparent black (and not any other transparent color), fixes #332
    • CSS: fix crash when rgb/rgba functions have less than three arguments
    • ๐Ÿ›  CSS: fix box-shadow value none conversion to 0 0 as they are not equivalent, fixes #332
    • ๐Ÿšš HTML: remove space between attributes when after a quoted value
    • ๐Ÿ›  HTML: keep empty title and lang attributes, fixes #331
    • ๐Ÿ”€ JS: merge variable declarations even if one has an ObjectPattern
    • ๐Ÿšš JS: remove trailing commas in BindingArray (except when Rest ellipsis is set)
    • ๐Ÿ›  JS: add parenthesis around object literal in arrow function body, fixes #333
  • v2.9.4

    September 04, 2020
    • ๐Ÿšš JS: don't remove braces when there are lexical declarations, fixes #326
    • ๐Ÿ›  JS: don't convert lexical declarations to expressions when hoisting variables, fixes #326
    • ๐Ÿ”€ JS: merge variable declaration and for initializer with variable declaration
  • v2.9.3

    September 02, 2020
    • ๐Ÿ›  CSS: minify comma-separated lists for box-shadow, background, background-repeat, background-size, and background-position properties (fixes #322)
    • ๐Ÿšš CSS/SVG: remove deprecated Decimals options in favor of Precision
    • ๐Ÿšš cmd: remove --decimals options for CSS and SVG minifiers in favor of --precision
    • ๐Ÿ”€ cmd: add --bundle option to explicitly bundle (concatenate/merge) files into one, do not asume from the -o options if it lacks a / at the end that it outputs to a file and thus needs to merge the inputs
    • 0๏ธโƒฃ cmd: directory inputs needs --recursive, previously directories would be expanded by defaults (but not their subdirectories). This matches behaviour of the cp command and will be more intuitive.
    • cmd: file inputs are copied without considering and recreating its directory path. For example, minify -o out path/to/file would output to out/path/to/file but will now output to out/file. This is the same behaviour as the cp command and will be more intuitive for users.
  • v2.9.2

    August 31, 2020
    • ๐Ÿ›  JS: only put var declaration into for or while, and not let nor const, fixes #325
    • ๐Ÿ”€ JS: merge more efficiently a var declaration with a for or while statement
  • v2.9.1

    August 29, 2020
    • ๐Ÿ“œ JS: fix parsing in identifier in group expressions
    • ๐Ÿ“œ JS: fix parsing identifiers inside arrow function body in some cases #324
    • JS: keep all license comments at the top of the file
    • JS: minify typeof x==='undefined' to typeof x=='undefined'
    • ๐Ÿ”€ JS: merge expressions and var declarations with for with empty initializer or with while statement converted to for
    • ๐Ÿ”€ JS: iteratively merge if(a){return b}if(c){return d}return e chains to return a?b:c?d:e
  • v2.9.0

    August 26, 2020
    • โž• Add JS (ECMAScript 2020) minifier
    • ๐Ÿ‘Œ Improve benchmark functions
    • ๐ŸŽ Predefine byte-slices instead of inline for performance
    • Don't check write errors to output during minification, but check at the end only
    • ๐Ÿ“œ Lexers/parser now require passing parse.Input instead of io.Reader
    • ๐Ÿ“ฆ Rename subpackage min to minify

    JS minifier overview

    ๐Ÿ”‹ Features:

    • โœ‚ remove superfluous whitespace
    • โœ‚ remove superfluous semicolons
    • shorten true, false, and undefined to !0, !1 and void 0
    • ๐Ÿ“‡ rename variables and functions to shorter names (not in global scope)
    • ๐Ÿšš move var declarations to the top of the global/function scope (if more than one)
    • collapse if/else statements to expressions
    • minify conditional expressions to simpler ones
    • ๐Ÿ”€ merge sequential expression statements to one, including into return and throw
    • โœ‚ remove superfluous grouping in expressions
    • ๐Ÿšš shorten or remove string escapes
    • convert object key or index expression from string to identifier or decimal
    • ๐Ÿ”€ merge concatenated strings
    • rewrite numbers (binary, octal, decimal, hexadecimal) to shorter representations

    It compresses files at about 25 MB/s (only minifying, not considering reading/writing files) which is (much) faster than existing minifiers. Compression rate is between 1.5 and 3.0 depending on the file (respectively, the compression file size is between 35% -- 65% of the original). Example of known files:

    File Original Size Compressed Size Ratio Time Speed
    ace.js 644 kB 346 kB 53.7% 34ms 19 MB/s
    dot.js 5.2 kB 3.3 kB 64.9% 563ยตs 9.2 MB/s
    jquery.js 247 kB 85 kB 34.4% 11ms 22 MB/s
    jqueryui.js 470 kB 241 kB 51.3% 26ms 18 MB/s
    moment.js 99 kB 35 kB 34.9% 4ms 24 MB/s

    โœ… The minifier has been tested for a number of web applications including WordPress. The go-fuzz fuzzer has been used extensively in order to detect bugs, and will continue finding bugs using

  • v2.8.0

    July 28, 2020

    WARNING for package maintainers, some files have been renamed , adjust your build scripts accordingly.

    • ๐Ÿš€ Use Makefile instead of GoReleaser to build releases for all architectures, use make release. This fixes the file location inside the archives to be in the root of the archive
    • ๐Ÿš€ Release archives will no longer have the version name explicitly stated, fixes #316
    • โœ‚ Remove cmd/minify/, use make install instead
    • Rename cmd/minify/minify_bash_tab_completion to cmd/minify/bash_completion
    • ๐Ÿ“‡ Rename to LICENSE as it is not a Markdown file
    • ๐Ÿ“ฆ Rename min subpackage to minify
    • ๐Ÿ–จ cmd: running minify without arguments will print a more informative error message
    • cmd: bad arguments will not display cmd usage automatically
  • v2.7.7

    July 24, 2020
    • ๐Ÿ cmd: fix file paths on Windows when input and output directories are equal (slash vs backslash)
    • cmd: add --cpuprofile and --memprofile options
    • ๐Ÿ”€ cmd: fix usage of --match and --sync simultaneously, fixes #315
    • cmd: --match applies to all filename inputs not just under directories
    • ๐Ÿšš CSS: remove whitespace around custom variable value, fixes #305
    • ๐Ÿ›  JSON: minify numbers, fixes #302
    • ๐Ÿ“œ HTML: fix slow parsing of <a> tag with many name or id attributes (OSS-Fuzz)
    • ๐Ÿ›  Don't replace space by + in DataURI, fixes #314
    • Don't escape @ : ; = ? + , / $ \t \n \r in DataURIs (works for Chrome, Firefox, Opera, Edge, Safari, Yandex, and IE9, IE10, IE11)