[英]VS Code, How to force a save on another file when I save files?
I'm using the VS code extension: Live Sass Compiler with Live Server and when I save other scss files than my style.scss it doesn't compile my style.scss file.我正在使用 VS 代码扩展: Live Sass Compiler with Live Server ,当我保存 style.scss 以外的其他 scss 文件时,它不会编译我的 style.scss 文件。 Is there a setting I missed to do this?有没有我错过的设置?
Since I did not find any setting for this, I thought I want to use a filewatcher so if any scss file is saved, I want to force a save on my style.scss to trigger the live sass compile.由于我没有找到任何设置,我想我想使用文件观察器,所以如果保存了任何 scss 文件,我想强制保存我的 style.scss 以触发实时 sass 编译。
So I added the extension File Watcher and now I wonder what cmd to use to force a save on my style.scss file.所以我添加了扩展文件观察器,现在我想知道用什么cmd来强制保存我的 style.scss 文件。 In File Watcher extension I get the echo everytime I save a.scss file using this:在 File Watcher 扩展中,每次我使用以下方法保存 a.scss 文件时都会得到回显:
{
"filewatcher.commands": [
{
"match": "\\.scss*",
"isAsync": true,
"cmd": "echo '${file} file content Changed'",
"event": "onFileChange"
}
]
}
I think I need a shell command or something to force a save on my style.scss file, but I have no idea how to do it.我想我需要一个 shell 命令或其他东西来强制保存我的 style.scss 文件,但我不知道该怎么做。 I was thinking something like ls style.scss but that is as far as I got.我在想像 ls style.scss 之类的东西,但就我所知。 Or can I trigger the sass live compile directly on the style.scss file?或者我可以直接在 style.scss 文件上触发 sass 实时编译吗?
I just needed to put underscore _ on my partial scss files.我只需要在我的部分 scss 文件上加上下划线 _。 Then it will recompile my style.scss file.然后它会重新编译我的 style.scss 文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.