I've spent a few days to configure a workflow within phpStrom and Compass usage.
Our project structure is divided on so-called extensions, where each extension is on same tree level and has it's own "Resources" folder with subfolders "Private/Sass" for .scss files and "Public/Css" for generated .css result.
Besicly, something like this:
Previously we were using raw Scss with PhpStorm's file watcher, which worked fine with follwong configuration
--no-cache --update $FileDir$\$FileName$:..\..\Public\Css\$FileNameWithoutExtension$.css --unix-newlines
Now we decided to use Compass and here my problems appeared.
As I understand, due to Compass nature it is not possible to have multiple input/output pathes configured, because Compass operates single folders, defined in config.rb in project root.
After multiple tries and errors I found two almsot good solutions, but none of them is perfect.
If we thik of Compass just as a library for Sass, we can still use scss compiler, but with option --compass
So, at the end we can still continue using Scss file watcher, but wit ha bit modified configuration
--update $FileDir$\$FileName$:..\..\Public\Css\$FileNameWithoutExtension$.css --unix-newlines --compass
You may notice, that I've removed --no-cache parameter - this is done due to performance reasons, since every @import "compass"; added about +5 seconds to compilation time and I don't mind about having .sass-cache folders in my local filesystem and project.
All the Compass features (including sprites generation) are available
But disadvantage is, that I'm loosing full power of compass compilation CLI (i.e. -e option). Also I'm not sure, if I later need some compass addon (like "susy" framework), taht it'll work smoothly.
Also I need config.rb in each folder and subfolder, that contains Scss and it must contain at least valid "images_dir" to be able to load images and generate sprites. However, "css_dir" and "sass_dir" as well as other useful options, like "output_style" are ignored.
After giving a chance to Scss watcher, I came back again to "scss compass" watcher.
Here I ebded up with creating separate watchers for each extension.
Therefore I need separate "config.rb" placed in each "Resources" directory and one "config.rb" in the root of my project to put it's path into "Compass support" -> "Config path" configuration. The latter is just a dummy, since it is used nowhere by compass - instead it uses those config files in "Resources".
So, each of my watchers contains such arguments:
And such working directory
Thie perfectly fits the structure, becasue then compass thinks of each "Resources" folder as of project root.
But seems, that phpStorm has complains about such a way.
It gives me a hint to add "compass scss" file watcher for each of my .scss file and on each file save it triggers all of created compass scss file watchers, which is not desired behaviour.
Does someone have similiar issue and solution to it?