Sass watch files in a folder and reduce, but manage the output file name

I know that I can watch one file in a folder and compress it like this:

sass --watch HealthyArticles.scss:HealthyArticles.min.css --style compressed

What I would like to do is:

sass --watch *.scss:*.min.css --style compressed

The problem is that I get the error:

Errno::EINVAL: Invalid argument - *.scss

The main thing is to manage the output file name. Is this possible with sass?

+3
source share
1 answer

I think you are probably looking for Compass. All these things are just baked into Rails, so I'm not sure exactly how everything links together, but I believe that if you use SCSS without a frame around it, then Compass is what you need.

Download from http://compass-style.org/ and do something like this:

gem install compass 
$ compass create asd --bare --sass-dir "input_directory" --css-dir "output_directory"

You can set this in the configuration file:

output_style = :compressed

script, - ( Ruby):

files = Dir["/path/to/scss/folder/*.scss"].map do |file|
  "#{file}:#{file.gsub(".scss", ".min.css")}"
end
`sass --watch #{files} --style compressed`
+2

All Articles