gpt4 book ai didi

css - WebCompiler 在 CI 构建中跳过 scss 文件

转载 作者:行者123 更新时间:2023-12-05 03:00:14 28 4
gpt4 key购买 nike

我的元素中有两个 scss 文件需要在我的 CI 构建期间(在 Azure Pipelines 上)进行编译。一个是在我本地构建时编译的,一个不是。我正在使用 WebCompiler,日志的输出显示了一个正在运行的文件,但没有显示丢失文件的任何错误。我的 CI 构建由 Devops 套件中的 Azure Pipelines 处理,由于某种原因,CI 构建的工作方式与本地构建不同。

最初,对于未编译的文件,我在 BuildAction 上遗漏了“内容”标识。我已经更正了,但它仍然没有被编译。我已经确认了 compilerconfig.json 文件的内容,两个文件都在那里。

这里是compilerconfig.json

[
{
"outputFile": "Content/custom-bootstrap.css",
"inputFile": "Content/custom-bootstrap.scss"
},
{
"outputFile": "Content/Site.css",
"inputFile": "Content/Site.scss"
}
]

这是来自 CI 构建日志文件(源自 Azure Pipelines)的片段。

WebCompile:

WebCompiler: Begin compiling compilerconfig.json
WebCompiler installing updated versions of the compilers...
Compiled Content/custom-bootstrap.css
Minified Content/custom-bootstrap.min.css
WebCompiler: Done compiling compilerconfig.json

这是来自本地构建日志的片段。

5>  WebCompiler: Begin compiling compilerconfig.json
5> Compiled Content/custom-bootstrap.css
5> Minified Content/custom-bootstrap.min.css
5> Compiled Content/Site.css
5> Minified Content/Site.min.css
5> WebCompiler: Done compiling compilerconfig.json

如有任何帮助,我们将不胜感激。

最佳答案

解决了我自己的问题...

看起来 WebCompiler 在从命令行运行时不会覆盖现有的 css 文件。

我无法让 WebCompiler 在我的 azure 构建上下文中编译此 css,因此我将 css 提交到我的源代码 repo。覆盖在本地构建中发生得很好。离开我的元素几个月后(没有新的开发或部署),我对解决这个问题产生了新的兴趣。事实证明,删除 css 文件现在允许 WebCompiler 为部署包创建 css。不知道为什么我很久以前不尝试这个,但很高兴能解决这个问题。

关于css - WebCompiler 在 CI 构建中跳过 scss 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56972466/

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