Settings & Commands
ℹ️ Hey! There’s a video that goes through these settings.
Watch it on YouTube now!
Contents
Settings
liveSassCompile.settings.formats
ℹ This setting can vary between workspace folders - [read more][multi-rootfaq]
An array of formats. Allows you save to multiple locations, with a customisable format and extension for each
| Properties | Type | Default | Notes |
|---|---|---|---|
| format | expanded OR compressed |
expanded |
The output style of the generated file |
| extensionName | string |
.css |
The extension suffix added to the output file (must end with .css) |
| savePath | string? |
null |
See [save path notes] |
| savePathReplacementPairs | Record<string, string>? |
null |
See [save path notes] |
| generateMap | boolean? |
null |
Choose to output maps at a format level instead |
| generateMapIncludeSources | boolean? |
false |
Include sourcesContent in the generated source map |
Examples
```js "liveSassCompile.settings.formats": [ // This is the default. { "format": "expanded", "extensionName": ".css", // null for all three -> denotes the same path as the SASS file "savePath": null, "savePathReplacementPairs": null }, // You can add more { "format": "compressed", "extensionName": ".min.css", // / -> denotes relative to the workspace root "savePath": "/dist/css" }, // More Complex // (See issue 26: https://github.com/ritwickdey/vscode-live-sass-compiler/issues/26) { "format": "compressed", "extensionName": ".m.css", // ~ -> denotes relative to each sass file "savePath": "~/../css/" }, // Segment replacement example { "format": "compressed", "extensionName": ".min.css", // "/Assets/SCSS/main.scss" => "/Assets/Style/main.min.css" // "/Assets/_SASS/main.sass" => "/Assets/Style/main.min.css" "savePathReplacementPairs": { "/SCSS/": "/Style/", "/_SASS/": "/Style/" }, // Don't create a map file for this "production" output "generateMap": false }, // Segment replacement can work with relative `savePath`s { "format": "compressed", "extensionName": "-min.css", // "/src/sass/Homepage/AHH/main.scss" => "/dist/css/Homepage/main-min.css" "savePath": "~/..", "savePathReplacementPairs": { "/src/sass": "/dist/css/" } } ] ```liveSassCompile.settings.excludeList
ℹ This setting can vary between workspace folders - [read more][multi-rootfaq]
Use an array of various glob patterns to exclude files or entire folders. All matching SASS/SCSS files or matching folders will be ignored.
Type: string[]?
Default
["/**/node_modules/**", "/.vscode/**"]
Other examples
**Negative glob pattern** To exclude all files except `file1.scss` & `file2.scss` from the directory `path/subpath`, you can use the expression: ```json "liveSassCompile.settings.excludeList": [ "/path/subpath/*[!(file1|file2)].scss" ] ``` **Regex pattern** Match regex expressions ```json "liveSassCompile.settings.excludeList": [ "/path/subpath/[A-Za-z0-9_]+.scss" ] ``` **POSIX brackets - [Full POSIX List]** Match alphas, alpha numerics, words and [more][full posix list] ```json "liveSassCompile.settings.excludeList": [ "/path/subpath/[:word:]+.scss" ] ```liveSassCompile.settings.includeItems
ℹ This setting can vary between workspace folders - [read more][multi-rootfaq]
Process only these specified files. Useful for when you deal with only a few sass files.
Type: string[]?
Default: null
NOTE: there is no need to include partial sass files.
Example
```json "liveSassCompile.settings.includeItems": [ "/path/subpath/a.scss", "/path/subpath/b.scss", ] ```liveSassCompile.settings.partialsList
ℹ This setting can vary between workspace folders - [read more][multi-rootfaq]
Using glob patterns, specify what files are actually partials - or what folders contain them
Type: string[]
Default
[ "/**/_*.s[ac]ss" ]
liveSassCompile.settings.generateMap
ℹ This setting can vary between workspace folders - [read more][multi-rootfaq]
Create a companion map file for each of the compiled files
Note: this can be overwritten in the formats[].generateMap setting
Type: boolean
Default: true
liveSassCompile.settings.generateMapIncludeSources
ℹ This setting can vary between workspace folders - [read more][multi-rootfaq]
Include sourcesContent in the generated source map for each compiled CSS.
Note: this can be overwritten in the formats[].generateMapIncludeSources setting
Type: boolean
Default: false
liveSassCompile.settings.autoprefix
ℹ This setting can vary between workspace folders - [read more][multi-rootfaq]
Autoprefix unsupported CSS properties (e.g. transform will also add -ms-transform). Uses [Browserslist] for browser selection
Type: boolean OR string[]
Default: "defaults"
- A
string[]will override the default browsers to add prefixes for - When
falseAutoprefixer is disabled - When
truewe will try and search for either:- a
.browserslistrcfile or, "browserslist": [ string[] ]in yourpackage.jsonfile
If neither of these are found then Autoprefixer will use"defaults"
- a
Note: for backwards compatibility with the original extension null is permitted. This has the same result as providing false
liveSassCompile.settings.showOutputWindowOn
Set the logging level at which errors will be shown in the output window. There is also a command.
Type: Trace, Debug, Information, Warning, Error or None
Default: Information
Choosing the right output level
- `None`: almost no output - Running the `liveSass.command.debugInclusion` (`Check file will be included`) command - Running the `liveSass.command.debugFileList` (`Get all included files`) command - When the `forceBaseDirectory` is not found or invalid (i.e. a file instead of a folder) - `Error`: this will output when compilation errors All of the above, plus - When there is an error or `@error` in your SASS - When autoprefixer errors, or is passed an invalid browserslist setting - If saving a file to the disk fails - `Warning`: this will output non-critical issues All of the above, plus - Primarily, workspace folder issues - `Information`: this will output file information All of the above, plus - When compilation is starting - When files have been generated (it outputs all files) - When the watch state is changed - `Debug`: this will output some info to help with debugging All of the above, plus - Details as to why files aren't compiling (not SASS, no active file, etc.) - Details of which files are being processed - `Trace`: this is primarily to aid in resolving problems All of the above, plus - A lot of sub-process by sub-process details of progressliveSassCompile.settings.hideOutputWindowOnSuccess
When enabled, the output window will be automatically hidden after all files compile successfully. This only takes effect when showOutputWindowOn is set to Warning or Error.
Type: boolean
Default: false
liveSassCompile.settings.showOutputWindow
ℹ This setting is deprecated in favour of
showOutputWindowOn. However, it will likely never be removed
This setting exists for backwards compatibility with the original extension
When true the extension will output all Information level messages (from above setting). When false it will report all Warning level messages (from above setting).
Type: boolean?
Default: null
liveSassCompile.settings.watchOnLaunch
Defines whether Live Sass should watch immediately over waiting to be started
Type: boolean
Default: false
liveSassCompile.settings.compileOnWatch
Defines whether Live Sass should compile all files when it starts watching
Type: boolean
Default: true
liveSassCompile.settings.workspacesAreLinked
Defines whether a partial file change should trigger recompilation across all workspace folders. Set to false if your workspace contains unrelated projects and you only want partials to recompile files within their own workspace folder.
Type: boolean
Default: true
liveSassCompile.settings.forceBaseDirectory
ℹ This setting can vary between workspace folders - [read more][multi-rootfaq]
Defines a subdirectory to search from. Add a small performance gain by targeting just your SASS folder.
No SASS/SCSS files outside of this folder will be watched/compiled when you save.
Type: string?
Default: null
⚠ It is your responsibility to ensure the path exists and is correct.
If the path is not found, or is a file, then it will output an error
If the path is wrong then nothing will be found nor compiled
⚠ This setting effects the root path for
includeItemsandexcludeList. So, a setting of/Assetsmeans thatincludeItemsandexcludeListare both relative to/Assetsand not/(the root of the workspace folder)
liveSassCompile.settings.rootIsWorkspace
ℹ This setting can vary between workspace folders - [read more][multi-rootfaq]
Tells the compiler that a leading slash is relative to the workspace root rather than the drive root.
Type: boolean
Default: false
liveSassCompile.settings.pathAliases
ℹ This setting can vary between workspace folders - [read more][multi-rootfaq]
A map of path prefixes to replacement paths for resolving Sass @use and @import rules. When an import path starts with a key, that prefix is replaced with the corresponding value. Prefixes are matched longest-first, so more specific aliases take priority.
Type: Record<string, string>?
Default:
{
"pkg:": "/node_modules/",
"~": "/node_modules/"
}
Path resolution rules:
- Replacement paths starting with
/are first resolved relative to each workspace folder root. If no match is found, they are tried as absolute filesystem paths (important for Linux, where absolute paths also start with/) - Replacement paths without a leading
/are treated as absolute paths - Set to
nullto disable all path alias resolution