🌐 AI搜索 & 代理 主页
Skip to content

Commit 3fd62ea

Browse files
committed
Switched from using YUI Compressor to Google Compiler. Minified and Gzipped 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.
1 parent 42f8c3a commit 3fd62ea

File tree

5 files changed

+25
-8
lines changed

5 files changed

+25
-8
lines changed

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ JQ_MIN = ${DIST_DIR}/jquery.min.js
2929
JQ_VER = `cat version.txt`
3030
VER = sed s/@VERSION/${JQ_VER}/
3131

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

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

@@ -66,7 +66,8 @@ min: ${JQ_MIN}
6666
${JQ_MIN}: ${JQ}
6767
@@echo "Building" ${JQ_MIN}
6868

69-
@@${MINJAR} ${JQ} > ${JQ_MIN}
69+
@@head -15 ${JQ} > ${JQ_MIN}
70+
@@${MINJAR} --js ${JQ} --warning_level QUIET >> ${JQ_MIN}
7071

7172
clean:
7273
@@echo "Removing Distribution directory:" ${DIST_DIR}

build.xml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,24 @@
7171
<include name="jquery.js" />
7272
</fileset>
7373
<arg line="-jar" />
74-
<arg path="build/yuicompressor-2.4.2.jar" />
75-
<arg value="--charset" />
76-
<arg value="ANSI" />
77-
<arg value="-o" />
74+
<arg path="build/google-compiler-20091218.jar" />
75+
<arg value="--warning_level" />
76+
<arg value="QUIET" />
77+
<arg value="--js_output_file" />
7878
<targetfile />
79-
<mapper type="glob" from="jquery.js" to="jquery.min.js" />
79+
<arg value="--js" />
80+
<mapper type="glob" from="jquery.js" to="tmpmin" />
8081
</apply>
82+
<concat destfile="${JQ_MIN}">
83+
<filelist files="${JQ}, dist/tmpmin"/>
84+
<filterchain>
85+
<headfilter lines="15"/>
86+
</filterchain>
87+
</concat>
88+
<concat destfile="${JQ_MIN}" append="yes">
89+
<filelist files="dist/tmpmin"/>
90+
</concat>
91+
<delete file="dist/tmpmin"/>
8192
<echo message="${JQ_MIN} built." />
8293
</target>
8394

build/google-compiler-20091218.jar

4.04 MB
Binary file not shown.

build/yuicompressor-2.4.2.jar

-831 KB
Binary file not shown.

src/intro.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@
22
* jQuery JavaScript Library v@VERSION
33
* http://jquery.com/
44
*
5-
* Copyright (c) 2009 John Resig
5+
* Copyright 2009, John Resig
66
* Dual licensed under the MIT or GPL Version 2 licenses.
77
* http://docs.jquery.com/License
88
*
9+
* Includes Sizzle.js
10+
* http://sizzlejs.com/
11+
* Copyright 2009, The Dojo Foundation
12+
* Released under the MIT, BSD, and GPL Licenses.
13+
*
914
* Date:
1015
*/
1116
(function(window, undefined){

0 commit comments

Comments
 (0)