问题
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.
来源:https://stackoverflow.com/questions/20661596/running-multiple-compass-sass-watch-operations-automatically