jQuery compiled with Google Closure Compiler

后端 未结 10 866
抹茶落季
抹茶落季 2020-11-29 04:52

Has anyone compiled jQuery against Google\'s newly-released Closure compiler?

There has been reported huge savings in code size. I\'m curious what the benefit is if

10条回答
  •  南方客
    南方客 (楼主)
    2020-11-29 05:47

    Doesn't Closure just minimize and renames vars? jQuery already has a .min version. Minifying with closure again will probably be minimally helpful and potentially dangerous.

    Edit: I just did it.

    Compilation was a success!
    
    Original Size:  55.91KB (19.28KB gzipped)
    Compiled Size:  54.05KB (18.28KB gzipped)
    Saved 3.34% off the original size (5.18% off the gzipped size)
    

    This is on top of the already mined version. There's a demo here: http://closure-compiler.appspot.com/home

提交回复
热议问题