Skip to content

Commit

Permalink
Switched from using YUI Compressor to Google Compiler. Minified and G…
Browse files Browse the repository at this point in the history
…zipped filesize reduced to 22,839 bytes from 26,169 bytes (13% decrease in filesize). Sizzle copyright was merged into the main header (since it's removed automatically). Still passes all unit tests.
  • Loading branch information
jeresig committed Dec 19, 2009
1 parent 42f8c3a commit 3fd62ea
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 8 deletions.
5 changes: 3 additions & 2 deletions Makefile
Expand Up @@ -29,7 +29,7 @@ JQ_MIN = ${DIST_DIR}/jquery.min.js
JQ_VER = `cat version.txt`
VER = sed s/@VERSION/${JQ_VER}/

MINJAR = java -jar ${BUILD_DIR}/yuicompressor-2.4.2.jar
MINJAR = java -jar ${BUILD_DIR}/google-compiler-20091218.jar

DATE=`git log -1 | grep Date: | sed 's/[^:]*: *//'`

Expand Down Expand Up @@ -66,7 +66,8 @@ min: ${JQ_MIN}
${JQ_MIN}: ${JQ}
@@echo "Building" ${JQ_MIN}

@@${MINJAR} ${JQ} > ${JQ_MIN}
@@head -15 ${JQ} > ${JQ_MIN}
@@${MINJAR} --js ${JQ} --warning_level QUIET >> ${JQ_MIN}

clean:
@@echo "Removing Distribution directory:" ${DIST_DIR}
Expand Down
21 changes: 16 additions & 5 deletions build.xml
Expand Up @@ -71,13 +71,24 @@
<include name="jquery.js" />
</fileset>
<arg line="-jar" />
<arg path="build/yuicompressor-2.4.2.jar" />
<arg value="--charset" />
<arg value="ANSI" />
<arg value="-o" />
<arg path="build/google-compiler-20091218.jar" />
<arg value="--warning_level" />
<arg value="QUIET" />
<arg value="--js_output_file" />
<targetfile />
<mapper type="glob" from="jquery.js" to="jquery.min.js" />
<arg value="--js" />
<mapper type="glob" from="jquery.js" to="tmpmin" />
</apply>
<concat destfile="${JQ_MIN}">
<filelist files="${JQ}, dist/tmpmin"/>
<filterchain>
<headfilter lines="15"/>
</filterchain>
</concat>
<concat destfile="${JQ_MIN}" append="yes">
<filelist files="dist/tmpmin"/>
</concat>
<delete file="dist/tmpmin"/>
<echo message="${JQ_MIN} built." />
</target>

Expand Down
Binary file added build/google-compiler-20091218.jar
Binary file not shown.
Binary file removed build/yuicompressor-2.4.2.jar
Binary file not shown.
7 changes: 6 additions & 1 deletion src/intro.js
Expand Up @@ -2,10 +2,15 @@
* jQuery JavaScript Library v@VERSION
* http://jquery.com/
*
* Copyright (c) 2009 John Resig
* Copyright 2009, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://docs.jquery.com/License
*
* Includes Sizzle.js
* http://sizzlejs.com/
* Copyright 2009, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
*
* Date:
*/
(function(window, undefined){
Expand Down

1 comment on commit 3fd62ea

@coling
Copy link

@coling coling commented on 3fd62ea Jan 19, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than using 15 lines hard coded into the build script (which is bound to break at some point), would it not be better to change src/intro.js to use a JSDoc comment market (/* rather than /!) and add either the @license or @preserve tags to the comment so that it is kept in the output?

Please sign in to comment.