Permalink
Browse files

Add support to "sass|scss" files.

  • Loading branch information...
arthurfurlan committed Oct 10, 2012
1 parent 66f6a0e commit 4c3f766ebc5af80e1a715c59d07393d7df549736
Showing with 21 additions and 0 deletions.
  1. +21 −0 src/minify.sh
View
@@ -128,6 +128,27 @@ find "$BASEDIR" -type f | egrep -v '\.min\.' | while read FILE; do
gzip_compressor "$DEST"
;;
+ sass|scss)
+ DEST="${NAME}.min.css"
+
+ ## check if the file needs to be minified
+ is_file_modified "$FILE" "$DEST"
+ [ "$?" = "1" ] || continue
+
+ ## create the new (and minified) version
+ echo "Compressing: ${DEST}"
+ sass --watch "${FILE}:${DEST}"
+
+ ## sass files cannot use the same rule of copying
+ ## the original file over the destination file if
+ ## the minified version was bigger than the original
+ ## because the sass syntax could not be a valid css
+ ## syntax
+
+ ## check if the file should be also compressed using gzip
+ gzip_compressor "$DEST"
+ ;;
+
png)
DEST="${NAME}.min.${TYPE}"
TEMP="${NAME}-nq8.${TYPE}"

0 comments on commit 4c3f766

Please sign in to comment.