实时SASS编译器未生成CSS文件

发布于 2025-02-12 01:00:03 字数 901 浏览 0 评论 0原文

我在 vscode 中使用 扩展名然后 css 在我保存 main.scs.scss 文件之前, css

例如,

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

+index.html

如果在 _sidebar.scss 中发生更改,则设有一个项目包含此目录,但没有发生任何事情,但是我保存 main.scs.scs.scss 文件和生成发生了。

它总是相同的,每次我使用 live sass编译器更改SCSS文件时,我很无聊,然后再次保存 main.scss 仅生成CSS文件。

我更改了设置中的Live Sass编译器设置。JSON

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

但是它在计算机中的任何文件夹中生成了所有SCSS文件,我不知道如何修复它。

我想每次在任何SCSS文件中发生更改时都会生成CSS文件

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

累赘 2025-02-19 01:00:03

只是为了让您知道,我所维护的叉子支持多根式工作区。如果安装它,则可以保持设置/结构相同,它只会工作

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

善良天后 2025-02-19 01:00:03

只需在设置中更改您的代码

{
"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"]

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"]

}

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文