Rawand122
Rawand122

Reputation: 375

live sass compiler not generating css files

I use live sass compiler extension in vsCode then generation css not worked for me until I save main.scss file.

for example have a project contains this directory

+style
 - style.css
 - main.scss
 - dashboard (folder)
  --_sidebar.scss

+index.html

if change happened in _sidebar.scss nothing happened, but then I save main.scss file and generation happened.

its always same and every time I use live sass compiler boring me when change SCSS file then again save main.scss just to generate CSS file.

I changed live sass compiler setting in setting.json to this:

"liveSassCompile.settings.formats": [
    {
      "format": "compressed",
      "extensionName": ".css",
      "savePath": "~/../style",
      "savePathSegmentKeys": null,
      "savePathReplaceSegmentsWith": null
    }
  ]

but it generate all SCSS files in any folder in my computer and I don't know how to fix it.

I want to generate CSS file every time when change happen in any SCSS file

Upvotes: 0

Views: 1320

Answers (2)

Angie Rabtsevych
Angie Rabtsevych

Reputation: 1

just change your code in settings.json to this one:

{
"liveSassCompile.settings.formats": [
  {
    "format": "expanded",
    "extensionName": ".css",
    "savePath": "/css"
  },
  {
    "format": "compressed",
    "extensionName": ".min.css",
    "savePath": "/css"
  }
],
"liveSassCompile.settings.excludeList": ["**/node_modules/**", ".vscode/**"],
"liveSassCompile.settings.generateMap": true,
"liveSassCompile.settings.autoprefix": ["> 1%", "last 2 versions"]

}

Upvotes: 0

glenn223
glenn223

Reputation: 303

Just to let you know, my maintained fork supports multi-root workspaces. if you install that, you can keep your settings/structure the same and it will just work

Upvotes: 1

Related Questions