【问题标题】:VS Code, How to force a save on another file when I save files?VS Code,保存文件时如何强制保存另一个文件?
【发布时间】:2021-03-21 04:01:55
【问题描述】:

我正在使用 VS 代码扩展名:Live Sass CompilerLive Server,当我保存 style.scss 以外的其他 scss 文件时,它不会编译我的 style.scss 文件。有没有我错过的设置?

由于我没有找到任何设置,我想我想使用文件观察器,所以如果保存了任何 scss 文件,我想强制保存我的 style.scss 以触发实时 sass 编译。

所以我添加了扩展名File Watcher,现在我想知道使用什么 cmd 来强制保存我的 style.scss 文件。在 File Watcher 扩展中,每次我使用以下方法保存 .scss 文件时都会得到回显:

{
  "filewatcher.commands": [
    {
      "match": "\\.scss*",
      "isAsync": true,
      "cmd": "echo '${file} file content Changed'",
      "event": "onFileChange"
    }
  ]
}

我想我需要一个 shell 命令或其他东西来强制保存我的 style.scss 文件,但我不知道该怎么做。我在想像 ls style.scss 之类的东西,但就我所知。或者我可以直接在 style.scss 文件上触发 sass 实时编译吗?

【问题讨论】:

    标签: visual-studio-code file-watcher live-sass-compiler liveserver


    【解决方案1】:

    我只需要在我的部分 scss 文件上加上下划线 _。然后它会重新编译我的 style.scss 文件。

    【讨论】:

      猜你喜欢
      • 2016-04-09
      • 2019-08-27
      • 1970-01-01
      • 1970-01-01
      • 2020-08-03
      • 1970-01-01
      • 2022-10-20
      • 2021-07-16
      • 1970-01-01
      相关资源
      最近更新 更多