glenn2223/vscode-live-sass-compiler

Different savePath based on source file location

zahedkamal87 opened this issue · 1 comments

Is there any way to compiled files to copy inside 2 different folder for 2 different sass file located in 2 different locations? eg. -
"liveSassCompile.settings.includeItems": [ "style.scss", "sass/plugin.scss" ],

style.scss to at workspace root "/style.css"
plugin.scss at "css/plugin.css"

Simply put, yes! You can use the liveSassCompile.settings.formats[].savePathReplacementPairs setting.

If you open your workspace settings JSON file you can adjust it, adding the important bit below:

{
  // ... Other settings
  "liveSassCompile.settings.formats": [
      {
// THE BIT YOU NEED
          "savePathReplacementPairs": { "/sass/": "/css/" },
// OTHER STUFF
          "format": "compressed", "extensionName": "-min.css"
      }
  ]
}

This will search the output path for the term /sass/ and replaces it with /css/. So, sass/plugin.scss will become css/plugin.css and because styles.scss doesn;t contain /sass/ it will just be output as styles.css


Closing this as the question is answered. However, please free to comment more if you need further help p(or if I didn't understand you correctly)