vvo / lazyload

:bullettrain_front: Lazyload images, iframes, widgets with a standalone JavaScript lazyloader
https://vvo.github.io/lazyload/
MIT License
938 stars 158 forks source link

Uglify config #67

Closed gmetais closed 9 years ago

gmetais commented 9 years ago

Hi vvo ;)

I'm surprised by the minification, which doesn't seem to be optimal.

The built file is 4575 bytes, but I can get it to 3943 bytes by minifying it with another tool. Could it be a problem with the uglifyify params?

(By the way, be careful with the screw-ie8 option!)

vvo commented 9 years ago

If you can get a lower build, show me how I will be glad to do it also.

gmetais commented 9 years ago

I'm not yet used to browserify, but didn't you just forget to call the uglifyify transform step?

gmetais commented 9 years ago

Wrong guess, it complains when I delete the module. I'll read the browserify doc!

vvo commented 9 years ago

but what tool do you use to compress? how did you get the 3943 bytes?

gmetais commented 9 years ago

https://marijnhaverbeke.nl/uglifyjs

Take a look at this issue on uglifyify: https://github.com/hughsk/uglifyify/issues/31

gmetais commented 9 years ago

V2.1.3 was 2982 bytes :astonished:

vvo commented 9 years ago

Yes, going browserify and modularity had its cost :) Maybe we could pass the browserify build to closure compiler instead.

You should also compare gzipped code:

Original Size: 1.72KB gzipped (4.47KB uncompressed) (uglify) Compiled Size: 1.54KB gzipped (3.67KB uncompressed) (closure compiler)

Do you want to shave 0.18kb? :D If yes, then Ill accept a PR.

gmetais commented 9 years ago

Fixed via #68.

Only 0.18kb less, yeah...

vvo commented 9 years ago

still good :)