visual-studio-codefile-watcherlive-sass-compilerliveserver

VS Code, How to force a save on another file when I save files?


I'm using the VS code extension: Live Sass Compiler with Live Server and when I save other scss files than my style.scss it doesn't compile my style.scss file. Is there a setting I missed to do this?

Since I did not find any setting for this, I thought I want to use a filewatcher so if any scss file is saved, I want to force a save on my style.scss to trigger the live sass compile.

So I added the extension File Watcher and now I wonder what cmd to use to force a save on my style.scss file. In File Watcher extension I get the echo everytime I save a .scss file using this:

{
  "filewatcher.commands": [
    {
      "match": "\\.scss*",
      "isAsync": true,
      "cmd": "echo '${file} file content Changed'",
      "event": "onFileChange"
    }
  ]
}

I think I need a shell command or something to force a save on my style.scss file, but I have no idea how to do it. I was thinking something like ls style.scss but that is as far as I got. Or can I trigger the sass live compile directly on the style.scss file?


Solution

  • I just needed to put underscore _ on my partial scss files. Then it will recompile my style.scss file.