Running multiple compass-sass watch operations aut

2019-02-16 01:04发布

问题:

This question already has an answer here:

  • SCSS/SASS Multiple Sites in Multiple Directories 1 answer

I am trying to determine the best possible approach for compass (sass) to watch multiple directories at once. Each directory represents an individual customer and their website.

/var/www/customers/domain1.com
/var/www/customers/domain2.com
/var/www/customers/domain3.com

I've come to understand it might require single processes for each watch command, what would be best practice for running & stopping these commands automatically, whenever a folder is added/deleted/moved?

回答1:

Maybe Grunt would be an approach instead of pure compass?

I'm using grunt-compass-multiple to be able to configure multiple sass directories to be watched: https://npmjs.org/package/grunt-compass-multiple

Grunt simply does nothing, if a specified directory is missing, so you would be able to delete one of the folders and still let the watch process take care of the others.

Adding/moving folders can be observed with the help of clever placeholder (*) rules.