1

I just have a big problem beginning with scss stuff. I have already install scss and add it to phpstorm as a "file watcher". Until there I was in a peacefull world but I tried to add a partials (file begining with a "_" which are included in the main file style.scss).

I want when I change the scss/style.scss OR partials/_variables.scss that the css/style.css updated.

So my problem is : When I change and save the style.scss file is ok, but when I change the _variables.scss, the style.css still the same.

Is there any way to WATCH the _variables.scss and generate automatically the main file if it's changed ?

I've already played with the scope of file watchers, but no way to do it ...

css/
    style.css
partials/
    _variables.scss
scss/
    style.scss
5
  • I use the LESS pre-processor in PHPStorm and include just my main file with all the @import's. THe FileWatcher also detects changes on other files in the same directory as the main file. Commented Sep 15, 2014 at 18:46
  • Ok but the css of the partials scss file are also generated, aren't they ? Commented Sep 15, 2014 at 18:49
  • 1
    That depends on the parameters you are passing to the SCSS parser in the FileWatcher dialog. Commented Sep 15, 2014 at 18:50
  • Juste the basic stuff : --no-cache --update $FileName$:../css/$FileNameWithoutExtension$.css (I know I shouldn't do that with "../" and use ProjectDirectory) Do you know a parameter to put a condition on which file we give on $FileName$ ? Commented Sep 15, 2014 at 18:58
  • Ok your answer made me think and I find a solution, Thanks. I've just had to regenrate only the style.scss file each time a file was changed. --no-cache --update $ProjectFileDir$/scss/style.scss:$ProjectFileDir$/css/style.css I'm not sure it's the perfect answer but it works Commented Sep 15, 2014 at 19:15

1 Answer 1

2

Thank you @feeela,

I have my answer :

Change listen all the changing scss, and generate the style.scss each time via

--no-cache --update $ProjectFileDir$/scss/style.scss:$ProjectFileDir$/css/style.css

So the partials are listened but only the style.css is generated. :)

Sign up to request clarification or add additional context in comments.

2 Comments

I'd suggest using --no-cache --update $FileName$:$ProjectFileDir$/css/$FileNameWithoutExtension$.css but make sure to tick 'track only root files' checkbox - should do the thing: watcher will listen to changes in all files, including partials, but only 'main' file (the one that imports other stuff) will be created
Thanks for your answer lena but that was the problem, the other files like _varaibles.scss were not watched. When I changed them, the style.css wasn't created because PHPStorm didn't notice any changes in style.scss. I'll have a problem if I want add another "root file", but for the moment it's ok.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.