【问题标题】:WebCompiler skipping an scss file in CI buildWebCompiler 在 CI 构建中跳过 scss 文件
【发布时间】:2019-07-10 14:04:16
【问题描述】:

我的项目中有两个 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 构建日志文件的 sn-p(源自 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

这是来自本地构建日志的 sn-p。

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

任何帮助将不胜感激。

【问题讨论】:

  • 我编辑了这个问题,以更好地说明 CI 构建的行为与本地构建不同 - 并且 CI 构建由 Azure Devops(管道)处理。

标签: css sass azure-devops continuous-integration web-compiler


【解决方案1】:

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

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

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

【讨论】:

    猜你喜欢
    • 2017-12-23
    • 2018-05-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-06
    • 2019-09-18
    • 1970-01-01
    • 2021-12-30
    相关资源
    最近更新 更多