minify javascript

This commit is contained in:
Stefan Bühler 2012-07-14 20:49:33 +02:00
parent 8a2a0a3a75
commit 3154f6b154
5 changed files with 20 additions and 10 deletions

View File

@ -6,10 +6,11 @@ MAPS+=$(wildcard ../maps/contest?.map ../maps/contest10.map)
MAPS+=$(wildcard ../maps/ems*.map) MAPS+=$(wildcard ../maps/ems*.map)
MAPS+=../maps/pacman.map ../maps/pacman2.map MAPS+=../maps/pacman.map ../maps/pacman2.map
all: maps.js sprites.png all: maps.js sprites.png gui.min.js mine.min.js maps.min.js
maps.js: mapsToJson.js $(MAPS) maps.js: FORCE
./mapsToJson.js $(MAPS) > maps.js ./mapsToJson.js $(MAPS) > maps.js.new
@if test ! -e maps.js || ! diff maps.js maps.js.new > /dev/null; then echo "new maps"; mv maps.js.new maps.js; else rm maps.js.new; fi
SPRITES=earth.png empty.png lambda.png liftclosed.png liftopen.png robot.png rock.png wall.png SPRITES=earth.png empty.png lambda.png liftclosed.png liftopen.png robot.png rock.png wall.png
SPRITES+=$(wildcard trampoline?.png) SPRITES+=$(wildcard trampoline?.png)
@ -22,10 +23,16 @@ sprites.png: $(SPRITES)
optipng -o9 tmp_sprites1.png optipng -o9 tmp_sprites1.png
mv tmp_sprites1.png sprites.png mv tmp_sprites1.png sprites.png
gui.min.js: gui.js
yui-compressor --type js --charset utf-8 -o $@ $<
mine.min.js: mine.js
yui-compressor --type js --charset utf-8 -o $@ $<
maps.min.js: maps.js
yui-compressor --type js --charset utf-8 -o $@ $<
clean: clean:
rm -f maps.js sprites.png rm -f maps.js sprites.png
.PHONY: all clean .PHONY: all clean FORCE
# just build it everytime
.PHONY: maps.js

1
js/gui.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
<html><head> <html><head>
<script type="text/javascript" src="maps.js"></script> <script type="text/javascript" src="maps.min.js"></script>
<script type="text/javascript" src="mine.js"></script> <script type="text/javascript" src="mine.min.js"></script>
<script type="text/javascript" src="gui.js"></script> <script type="text/javascript" src="gui.min.js"></script>
<title>ICFP Contest 2012 Simulator</title> <title>ICFP Contest 2012 Simulator</title>
</head><body> </head><body>
<h2>ICFP Contest 2012 Simulator</h2> <h2>ICFP Contest 2012 Simulator</h2>

1
js/maps.min.js vendored Normal file

File diff suppressed because one or more lines are too long

1
js/mine.min.js vendored Normal file

File diff suppressed because one or more lines are too long