gpt4 book ai didi

sass - 配置 "Live Sass Compiler"(VSCode模块)

转载 作者:行者123 更新时间:2023-12-05 07:33:52 24 4
gpt4 key购买 nike

我尝试配置模块“Live Sass Compiler”以将 css 文件放在其他目录而不是带有 scss 文件的目录中,但是我遇到错误,或者什么都不做。

我做了一个目录/项目来测试它。

Root : C:\\test_space\\sass_compiler_config
Tree:
+ sass_compiler_config
+ build
+ src
+ modules
+ variables.scss
+ style.scss

这是我想用来检查它是否有效的测试配置:

{
"liveSassCompile.settings.generateMap" : false,
"liveSassCompile.settings.showOutputWindow": true,
"liveSassCompile.settings.formats":[
{
"format": "expanded",
"extensionName": ".css",
"savePath": "/sass_compiler_config/build/styles"
}
],
"liveSassCompile.settings.excludeList": [
"**/node_modules/**",
".vscode/**"
],
"liveSassCompile.settings.includeItems": [
"/sass_compiler_config/src/style.scss",
],
"liveSassCompile.settings.autoprefix": [
"> 1%",
"last 2 versions"
]
}

我尝试创建一个名为“.vscode”的目录,其中包含一个文件“settings.json”,并将其添加到工作区。我收到此错误:现在无法应用此设置。当您直接打开此文件夹时应用它。

我试着把它放在工作区配置中:

{
"folders": [
{
"path": "C:\\test_space\\.vscode"
},
{
"path": "C:\\test_space\\sass_compiler_config"
}
],
"settings": {
{
"liveSassCompile.settings.generateMap" : false,
"liveSassCompile.settings.showOutputWindow": true,
"liveSassCompile.settings.formats":[
{
"format": "expanded",
"extensionName": ".css",
"savePath": "/sass_compiler_config/build/styles"
}
],
"liveSassCompile.settings.excludeList": [
"**/node_modules/**",
".vscode/**"
],
"liveSassCompile.settings.includeItems": [
"/sass_compiler_config/src/style.scss",
],
"liveSassCompile.settings.autoprefix": [
"> 1%",
"last 2 versions"
]
}
}
}

没有错误,但什么也不做。可能是我的路径错误。

最佳答案

如我所料;如果是这样的话,您想保存相对于工作区根目录或 Sass 文件的位置

* Default value is null. (null means, it will generate CSS in the location of scss/sass. By The Way, It is null, NOT "null").

* "/" denotes relative to root.

* "~" denotes relative to every sass file. - Complex Scenario.

请检查documentation这是result

关于sass - 配置 "Live Sass Compiler"(VSCode模块),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50386835/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com