Set the Output Path for Compiled CSS in VS Code Live Sass Compiler

Quick Summary

  • Add a liveSassCompile.settings.formats entry with savePath in settings.json to send Live Sass Compiler output to a folder like assets/css/.
  • A savePath starting with ~ is relative to each SCSS file, so ~/../assets/css/ goes up one folder, then into assets/css/.
  • Put the settings in a project's .vscode/settings.json to apply them there only, and click Watch Sass in the status bar to start compiling.

The Live Sass Compiler extension for VS Code saves compiled CSS files next to your SCSS files by default. To write them to a separate folder, such as assets/css/, set the output path in the extension’s settings.

Use the Live Sass Compiler by Glenn Marks. The original extension by Ritwick Dey hasn’t been updated since 2018; Glenn Marks’ version continues it under the same name and uses the same liveSassCompile.settings keys shown below.

Where to add the settings

Open the Live Sass Compiler extension settings in VS Code and follow the link to edit them in settings.json. Add the lines below inside the outer curly braces, separated from the existing settings by commas. To apply them to one project only, put them in that project’s .vscode/settings.json instead.

Code
"liveSassCompile.settings.autoprefix": [],
    "liveSassCompile.settings.formats": [
        {
            "format": "expanded",
            "extensionName": ".css",
            "savePath": "~/../assets/css/"
        }
    ]

What the settings do

  • formats is a list of output files. Each entry creates one CSS file, so you can add a second entry, for example for a minified version.
  • "format": "expanded" writes readable, indented CSS. Use "compressed" for minified output.
  • extensionName is the file extension of the output, here .css.
  • savePath is the output folder. A path that starts with ~ is relative to each SCSS file, so ~/../assets/css/ goes up one folder from the SCSS file and then into assets/css/. With your SCSS in scss/style.scss, the output is assets/css/style.css.
  • autoprefix is the extension’s vendor-prefix option; the snippet sets it to an empty list.

Save the file and click Watch Sass in the status bar to start compiling. If this setup doesn’t fit your project, the Stack Overflow discussion on this setting has other possible fixes.

Share on X (opens in a new tab) Share on LinkedIn (opens in a new tab) Share on Facebook (opens in a new tab)

ChatGPT (opens in a new tab) Claude (opens in a new tab) Gemini (opens in a new tab) Perplexity (opens in a new tab) Grok (opens in a new tab)

More Insights

See More