minify
minify copied to clipboard
Planned improvements
Also see https://github.com/tdewolff/parse/issues/44
- [x]
Renameunlikely due to insignificant performance gainMinifyMimetypetoMinifyBytesor similar, and accept[]byteinstead ofio.Reader, make all other functions that explicitly convert tobuffer.NewReader(b)to use this new function. Keep the originalMinifyMimetypebut mark as deprecated. - [x] SVG paths: use
S,Q,T,Lor remove if (some) control points coincide for curved paths. - [x] CSS: shorten dimensions, for example
200grad->180deg. But also0ms->0sand500ms->.5sor.005s->5ms. - [x] CSS: take care of comma separations in
background - [ ] CSS: filter declaration blocks for duplicate property definitions, i.e. remove earlier
background-positionif eitherbackgroundorbackground-positionis set afterwards - [ ] CSS: remove
%from0%where possible - [ ] CSS: minify aggregate declarations better, such as
grid,transition, ... - [ ] CSS: find where the initial value is shorter than
initial - [ ] CSS: remove dimension for zero values if possible
- [ ] CSS: check if remove duplicate property definitions can be removed (see multiple
backgroundwith-moz-linear-gradient,-ie-linear-gradient). - [ ] CSS: add implementation for more functions and value types, for example
calc,min,max,clamp,transform+ related functions in with (https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function),linear-gradient(ie. the<gradient>type) (https://developer.mozilla.org/en-US/docs/Web/CSS/gradient), and more. - [ ] CSS: find more optimizations from https://cssnano.co/optimisations/ and https://github.com/css/csso/tree/master/test/fixture/compress
- [x]
cmd: refactor and separate reusable code - [x]
cmd: allow options input from command line, config file and environment variables - [ ] Find faster hash function
- [x] Set proper
capon parsers and helper functions, does this prevent the need forcopy? - [x] JS: use template strings where we can convert \n to a newline, as well as \r as a carriage return
- [x] JS: order var declarations without definition to improve GZIP