2

I am trying to setup a file watcher for scss files which is working on files with a filename not starting with _.

But if I have a file named _file_name.scss the output of any macros that include the filename will be file.name.scss.

The first _ is removed and following ones are replaced by ..

Even though in the insert macros selection tool I can see that the output when you select a macro is correct.

Like $FilePathRelativeToProjectRoot$ will display mypath/_file_name.scss in the selection tool but then my command from this file watcher will output mypath/file.name.scss.

Am I missing a parameter here ?

Full configuration: enter image description here

mate2
  • 175
  • 11
  • Please post the full watcher configuration – muecas Jun 21 '18 at 22:35
  • Added a picture of the watcher config – mate2 Jun 21 '18 at 23:02
  • The problem is the usage of prettier. Do you have a configuration file for prettier or you are just using the default config? By the way prettier is not compiling your sass files. Don’t you have another watcher for that? – muecas Jun 21 '18 at 23:53
  • Yeah the compiling is handle by webpack. There is a prettier config and it's working fine, vscode works fine with it, webstorm too for file not starting with `_`. The param `COMPILE_PARTIAL=true` to add in environment variables of file watcher config as @lena suggest in his answer solve the issue. – mate2 Jun 22 '18 at 12:05

1 Answers1

4

For me, existing file names are not changed when using similar file watcher. But files with names starting the _ are not prettified, the main .scss that includes them is processed instead. To avoid this, try adding COMPILE_PARTIAL=true variable to your file watcher settings:

enter image description here

Also, make sure that Track only root files is off.

See the comments in https://youtrack.jetbrains.com/issue/WEB-13459

lena
  • 90,154
  • 11
  • 145
  • 150