I have it working, but with these settings it takes quite a while until the change comes through in PhpStorm. If I get rid of the ../css/
part of the argument string then it creates/updates the css file in the same directory as the scss file is in, but does it immediately. What am I doing wrong?
I'm using PhpStorm 6.0.1 on OS X 10.8.3
Creating a File WatcherIn the Settings/Preferences dialog ( Ctrl+Alt+S ), click File Watchers under Tools. The File Watchers page opens showing a list of File Watchers that are already configured in this project and in the IDE. and choose the predefined template from which you want to create a File Watcher.
To start, create a folder with two folders inside, CSS and images. Then inside the CSS folder create a file with the Sass extension – in my case it's style. scss. Then open it and the file will be detected right away.
as it's mentioned in the previous answer, you have to set up the Output paths option accordingly. Like:
Arguments: --no-cache --update $FileName$:$FileParentDir$/css/$FileNameWithoutExtension$.css
Working directory: $FileDir$
Output Paths: $FileParentDir$/css/$FileNameWithoutExtension$.css
Now output paths matches the scss output directory, so that the IDE knows where to look for output and what it looks like
I recommend using node-sass it's 10+ times faster
npm install -g node-sass
Program :
/usr/local/bin/node-sass
Arguments :
$FileName$ $FileNameWithoutExtension$.css
Output Paths :
$FileNameWithoutExtension$.css:$FileNameWithoutExtension$.css.map
Edit :
If you want the css file compressed, use that for the Arguments :
--output-style compressed $FileName$ $FileNameWithoutExtension$.css
For anyone uses node-sass in Windows Env, here you go,
Program:
Windows
C:\Users\%username%\AppData\Roaming\npm\node-sass.cmd
Linux
/usr/local/bin/node-sass
Arguments (Windows):
$FileName$ $ProjectFileDir$\dist\$FileNameWithoutExtension$.css
Output paths for refresh(windows):
$ProjectFileDir$\dist\$FileNameWithoutExtension$.css
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With