Browse Source

Use only closure compiler for dist InitJS minify

pull/30/head
Sami Vaarala 11 years ago
parent
commit
badf166308
  1. 2
      Makefile
  2. 46
      util/make_dist.sh

2
Makefile

@ -721,7 +721,7 @@ doc/%.html: doc/%.txt
# Source distributable for end users
# XXX: want to run debuglogcheck when dist gets built, but don't want to depend on it.
# XXX: make prints a harmless warning related to the sub-make.
dist: UglifyJS UglifyJS2 compiler.jar cloc-1.60.pl
dist: compiler.jar cloc-1.60.pl
@make debuglogcheck
sh util/make_dist.sh

46
util/make_dist.sh

@ -303,30 +303,30 @@ cat src/duktape.h.in | sed -e '
> $DISTSRCSEP/duktape.h
# Initjs code: built-in Ecmascript code snippets which are evaluated when
# a new global context is created. UglifyJS or the closure compiler is
# used to compact the source. Obfuscating the code is not a goal, although
# that happens as an unwanted side effect.
# a new global context is created. There are multiple minifiers, closure
# seems to be doing the best job so only that is enabled now. Obfuscating
# the code is not a goal, although that happens as an unwanted side effect.
#
# Closure compiler --compilation_level ADVANCED_OPTIMIZATIONS breaks some
# of the existing code, so don't use it.
cat src/duk_initjs.js \
| UglifyJS/bin/uglifyjs --ascii --no-dead-code --no-copyright \
> $DISTSRCSEP/duk_initjs_uglify.js.tmp
if [ $? -ne 0 ]; then
echo "UglifyJS initjs step failed"
exit 1
fi
UglifyJS2/bin/uglifyjs \
src/duk_initjs.js \
--screw-ie8 \
--compress warnings=false \
> $DISTSRCSEP/duk_initjs_uglify2.js.tmp
if [ $? -ne 0 ]; then
echo "UglifyJS2 initjs step failed"
exit 1
fi
#cat src/duk_initjs.js \
# | UglifyJS/bin/uglifyjs --ascii --no-dead-code --no-copyright \
# > $DISTSRCSEP/duk_initjs_uglify.js.tmp
#if [ $? -ne 0 ]; then
# echo "UglifyJS initjs step failed"
# exit 1
#fi
#UglifyJS2/bin/uglifyjs \
# src/duk_initjs.js \
# --screw-ie8 \
# --compress warnings=false \
# > $DISTSRCSEP/duk_initjs_uglify2.js.tmp
#if [ $? -ne 0 ]; then
# echo "UglifyJS2 initjs step failed"
# exit 1
#fi
java -jar compiler.jar \
--warning_level QUIET \
@ -340,8 +340,10 @@ if [ $? -ne 0 ]; then
fi
INITJS_ORIG=`wc -c < src/duk_initjs.js`
INITJS_UGLIFY=`wc -c < $DISTSRCSEP/duk_initjs_uglify.js.tmp`
INITJS_UGLIFY2=`wc -c < $DISTSRCSEP/duk_initjs_uglify2.js.tmp`
INITJS_UGLIFY=DISABLED
INITJS_UGLIFY2=DISABLED
#INITJS_UGLIFY=`wc -c < $DISTSRCSEP/duk_initjs_uglify.js.tmp`
#INITJS_UGLIFY2=`wc -c < $DISTSRCSEP/duk_initjs_uglify2.js.tmp`
INITJS_CLOSURE=`wc -c < $DISTSRCSEP/duk_initjs_closure.js.tmp`
echo "Minified initjs size: original=$INITJS_ORIG, UglifyJS=$INITJS_UGLIFY, UglifyJS2=$INITJS_UGLIFY2, closure=$INITJS_CLOSURE"

Loading…
Cancel
Save