|
|
|
@ -3,13 +3,15 @@
|
|
|
|
|
# minifies jquery.isotope.js |
|
|
|
|
# requires nodejs & uglifyjs |
|
|
|
|
|
|
|
|
|
JS=jquery.isotope.js |
|
|
|
|
JS_MIN=jquery.isotope.min.js |
|
|
|
|
IN=jquery.isotope.js |
|
|
|
|
OUT=jquery.isotope.min.js |
|
|
|
|
|
|
|
|
|
# minify with UglifyJS |
|
|
|
|
# remove any lines that begin with /*jshint or /*global |
|
|
|
|
# then, minify with Uglify JS |
|
|
|
|
# then, add newline characters after `*/`, but not last newline character |
|
|
|
|
uglifyjs $JS \ |
|
|
|
|
| awk '{ORS=""; gsub(/\*\//,"*/\n"); if (NR!=1) print "\n"; print;}' > $JS_MIN |
|
|
|
|
awk '!/^\/\*[jshint|global]/' $IN \ |
|
|
|
|
| uglifyjs \ |
|
|
|
|
| awk '{ORS=""; gsub(/\*\//,"*/\n"); if (NR!=1) print "\n"; print;}' > $OUT |
|
|
|
|
# add trailing semicolon |
|
|
|
|
echo ';' >> $JS_MIN |
|
|
|
|
echo "Minified" $JS "as" $JS_MIN |
|
|
|
|
echo ';' >> $OUT |
|
|
|
|
echo "Minified" $IN "as" $OUT |
|
|
|
|