1
votes

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
1
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. - feeela
Ok but the css of the partials scss file are also generated, aren't they ? - Thomas Leduc
That depends on the parameters you are passing to the SCSS parser in the FileWatcher dialog. - feeela
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$ ? - Thomas Leduc
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 - Thomas Leduc

1 Answers

2
votes

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. :)