minify JS files

This commit is contained in:
Roland Gruber 2014-03-08 13:37:43 +00:00
parent c0a4fecfec
commit dc4c045201
3 changed files with 21 additions and 4 deletions

View File

@ -3,7 +3,7 @@ Maintainer: Roland Gruber <post@rolandgruber.de>
Section: web
Priority: extra
Standards-Version: 3.9.5
Build-Depends: debhelper (>= 7), po-debconf
Build-Depends: debhelper (>= 7), po-debconf, yui-compressor
Homepage: https://www.ldap-account-manager.org/
Package: ldap-account-manager

19
lam-packaging/debian/minify Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
set -e
dir="templates/lib"
files=`ls $dir/*.js`
for file in $files; do
# skip dropmenu file, incompatible with YUI compressor
if [[ $file =~ .*dropmenu.* ]]; then
continue
fi
yui-compressor --nomunge --preserve-semi --disable-optimizations --charset UTF-8 -o ${file}-MIN $file
rm $file
mv ${file}-MIN $file
# add final new line to supress Debian warnings
echo "" >> $file
done

View File

@ -11,9 +11,7 @@ build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
yui-compressor --nomunge --preserve-semi --disable-optimizations --charset UTF-8 -o templates/lib/500_lam.js-TMP templates/lib/500_lam.js
rm templates/lib/500_lam.js
mv templates/lib/500_lam.js-TMP templates/lib/500_lam.js
minify
build-stamp: