2

I'm trying to use WebStorm's SCSS file watcher, but no matter what settings I change it always outputs the generated .css file to the same directory as the .scss file.

I've tried changing the "arguments" from:

--no-cache --update $FileName$:$FileNameWithoutExtension$.css

to:

--no-cache --update ../$FileName$:$FileNameWithoutExtension$.css

but the output file is still generated in the same place. However, I did modify and save my .scss file, saw the file watcher trigger, and saw that the generated file changed ... it just didn't put the changed version in a different location.

I tried providing --output and -o options, but was told those are invalid (which makes sense because the command-line SCSS expects the output to be an argument not an option). So then I tried using just:

../$FileName$:$FileNameWithoutExtension$.css

no luck. Then I thought "maybe it's the 'Output paths to refresh'", so I changed that from:

$FileNameWithoutExtension$.css:$FileNameWithoutExtension$.css.map

to:

../$FileNameWithoutExtension$.css:$FileNameWithoutExtension$.css.map

... and still, I just get the output file in the same directory.

Is it even possible to make WebStorm output to somewhere else, or is the output path fixed?

machineghost
  • 33,529
  • 30
  • 159
  • 234
  • I'm not using SCSS myself .. but as far as I'm aware you need to modify path **after** `:` and not before, e.g. something like `$FileName$:$FileParentDir$/$FileNameWithoutExtension$.css` – LazyOne Aug 14 '16 at 18:17
  • *" Then I thought "maybe it's the 'Output paths to refresh'""* Nope. The `Output path to refresh` field is for IDE to look for the changed files and group/nest generated files under source file -- [it does not affect generated file location at all](https://www.jetbrains.com/phpstorm/help/new-watcher-dialog.html?search=file%20watchers#immediateFileSynchronization). – LazyOne Aug 14 '16 at 18:19
  • In general: http://stackoverflow.com/a/29096837/783119 – LazyOne Aug 14 '16 at 18:19

1 Answers1

1

Ex: If you want the css in root/css/

Just give "--no-cache --update $FileName$:$FileParentDir$/css/$FileNameWithoutExtension$.css" to "Arguments"

5cel
  • 64
  • 5
  • It gave me the following error: Could not find an option named "cache". I had to give this " --watch --update $FileName$:$FileParentDir$/css/$FileNameWithoutExtension$.css" instead to "Arguments" – Chris Claude Jan 16 '21 at 16:01