diff --git a/build/preprocess.sh b/build/preprocess.sh index 78e14c8c..bdee8f0e 100755 --- a/build/preprocess.sh +++ b/build/preprocess.sh @@ -34,12 +34,9 @@ OPTIONS=$(printf '%q' $(node -e " ")) # Build the prepo.js command out of it, passing on version and date as defines: COMMAND="../node_modules/.bin/prepro -o $OPTIONS -o '{ \"date\": \"$DATE\" }' $3 $2" +# Flags to pass to prepro +if [ $1 = "stripped" ]; then FLAGS="-c"; else FLAGS=""; fi -case $1 in - commented) - eval $COMMAND > $4 - ;; - stripped) - eval "$COMMAND -c" > $4 - ;; -esac +eval "$COMMAND $FLAGS" > $4 +# Now convert 4 spaces to tabs, to shave of some bytes (quite a few KB actually) +unexpand -t 4 $4 > "$4-tabs" && mv "$4-tabs" $4