Search code examples
phpcsssassphpstormfile-watcher

SCSS filewacher/compiler takes far too long to 'execute' in phpstorm


I'm using phpstorm and I've put a filewatcher on my styles.scss file and have noticed that it takes a very long amount of time to compile changes into my styles.css file.

For example, if I add new attributes to any class, id, element the compiler will take about 5 seconds before it compiles. Is this a normal amount of time? Surely there is a way to speed this up.

My settings for the filewatcher are as follows in phpstorm:

Trigger regardless of syntax errors:Unchecked

Arguments:--precision 10 --no-cache --update $FileName$:$FileNameWithoutExtension$.css"


Solution

  • I figured out a quicker way to get this compiler working for everyone outthere.

    1. Ensure that 'sassc' is installed. (in terminal type in 'which sassc' without quotes)
    2. If you dont have it installed, brew install sassc should work given you have homebrew.
    3. Go into php storm and find where your file watcher is under preferences. Enter the following into the 'program' field: /usr/local/bin/sassc
    4. In the 'arguments' field enter: --precision 10 --sourcemap $FileName$ $FileNameWithoutExtension$.css
    5. BOOM, straight compilin' at the speed of light, yo.