我的项目中有两个scss文件,这些文件需要在CI构建期间(在Azure Pipelines上)进行编译。当我在本地构建时,一种正在编译,而另一种则不是。我正在使用WebCompiler,日志的输出显示了一个正在运行的文件,但对于丢失的文件未显示任何错误。我的CI版本由Devops套件中的Azure Pipelines处理,由于某些原因,CI版本与本地版本的工作方式不同。
最初,对于未编译的文件,我在BuildAction上缺少“ Content”标识。我已经纠正了这个问题,但是仍然没有得到编译。我已经确认了editorconfig.json文件的内容,并且两个文件都在那里。
这是editorconfig.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
任何帮助将不胜感激。
答案 0 :(得分:3)
解决了我自己的问题...
从命令行运行时,看起来WebCompiler不会覆盖现有的CSS文件。
我无法在我的azure构建环境中让WebCompiler编译此CSS,所以我将CSS提交给了我的源代码回购。覆盖发生在本地版本中很好。在离开我的项目几个月(没有新开发或部署)之后,我对解决这个问题重新产生了兴趣。事实证明,删除css文件现在允许WebCompiler为部署程序包创建css。不知道为什么我不久前没有尝试过,但是很高兴能克服这个问题。