Bot releases are hidden (Show)
Published by tdewolff about 4 years ago
Precision
option in minifying numbersforeignObject
tagsPublished by tdewolff about 4 years ago
Published by tdewolff about 4 years ago
transparent
only if the color is fully transparent black (and not any other transparent color), fixes #332box-shadow
value none
conversion to 0 0
as they are not equivalent, fixes #332title
and lang
attributes, fixes #331Published by tdewolff about 4 years ago
Published by tdewolff about 4 years ago
box-shadow
, background
, background-repeat
, background-size
, and background-position
properties (fixes #322)Decimals
options in favor of Precision
--decimals
options for CSS and SVG minifiers in favor of --precision
--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--recursive
, previously directories would be expanded by defaults (but not their subdirectories). This matches behaviour of the cp
command and will be more intuitive.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.Published by tdewolff about 4 years ago
var
declaration into for
or while
, and not let
nor const
, fixes #325var
declaration with a for
or while
statementPublished by tdewolff about 4 years ago
in
identifier in group expressionstypeof x==='undefined'
to typeof x=='undefined'
for
with empty initializer or with while
statement converted to for
if(a){return b}if(c){return d}return e
chains to return a?b:c?d:e
Published by tdewolff about 4 years ago
parse.Input
instead of io.Reader
min
to minify
Features:
true
, false
, and undefined
to !0
, !1
and void 0
var
declarations to the top of the global/function scope (if more than one)if
/else
statements to expressionsreturn
and throw
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 https://github.com/google/oss-fuzz
Published by tdewolff about 4 years ago
WARNING for package maintainers, some files have been renamed, adjust your build scripts accordingly.
make release
. This fixes the README.md
file location inside the archives to be in the root of the archivecmd/minify/install.sh
, use make install
insteadcmd/minify/minify_bash_tab_completion
to cmd/minify/bash_completion
LICENSE.md
to LICENSE
as it is not a Markdown filemin
subpackage to minify
minify
without arguments will print a more informative error messagePublished by tdewolff about 4 years ago
--cpuprofile
and --memprofile
options--match
and --sync
simultaneously, fixes #315--match
applies to all filename inputs not just under directories<a>
tag with many name
or id
attributes (OSS-Fuzz)+
in DataURI, fixes #314@ : ; = ? + , / $ \t \n \r
in DataURIs (works for Chrome, Firefox, Opera, Edge, Safari, Yandex, and IE9, IE10, IE11)Published by tdewolff over 4 years ago
select
and optgroup
tagsmin/
subpackagePublished by tdewolff over 4 years ago
flex
, default of flex-basis
is zero for three value case, fixes #292@import url(...)
, fixes #296Published by tdewolff over 4 years ago
$in
and $out
keywordsforeignObject
, fixes #291Published by tdewolff almost 5 years ago
C
, S
, Q
, and T
commands where if the control points would not overlap with the start or end points of the curve, it would still be converted to a line.Published by tdewolff almost 5 years ago
Published by tdewolff almost 5 years ago
Decimal
and Number
now take precision to mean the number of significant digits, and not the number of digits behind the dot (decimals); includes a few subtle bugfixes. Decimals
option renamed to Precision
Hash
definitions and EntitiesMap
from tdewolff/parse
to this repository to prevent releasing new versions of tdewolff/parse
everytime--sync
functionality--watch
work for newly created directoriescolor
, background-color
, border-color
, border-*-color
, caret-color
, outline-color
, fill
, stroke
, column-rule
, text-shadow
, text-decoration
, text-emphasis
, flex
, flex-*
, order
, fixes #217background
better if it has multiple layersbox-shadow
minificationcalc
, min
, max
, clamp
, attr
, var
A
command correctly with boolean largeArc
and sweep
Published by tdewolff almost 5 years ago
Add install.sh
and Makefile
to ./cmd/minify
.
No changes to binaries (use v2.6.2).
Published by tdewolff almost 5 years ago
amp-boilerplate
KeepQuotes
option for attributesPublished by tdewolff almost 5 years ago
Upgrade to tdewolff/[email protected]:
0xC0
usually followed by more bytes).Published by tdewolff almost 5 years ago
margin:calc(10px) calc(20px)
=> margin:calc(10px)calc(20px)
A
path command correctly when the booleans largeArc
and sweep
are not separated by a space, such as in A10 10 0 0120 0
which is equivalent to A10 10 0 0 1 20 0
" => "
, " => "
, " => "
, ’ => ’
, ✏ => ✏
.