首页 > 解决方案 > Angular CLI:TFS 构建步骤中的 ng 构建警告

问题描述

我有一个我正在尝试通过 Azure DevOps 构建的 Angular 项目。当我在库项目上运行 ng build 时,有一些警告

ex(##[error]WARNING: autoprefixer: D:\Agent_work\1\s\Test\projects\test-library\src\components\test.component.css:4:5: start value has mixed support,考虑使用flex-start 代替)

构建步骤因此失败。这一步的命令是“ng build test-library”

TFS 中有没有办法或 ng build 上的设置忽略这些警告?

标签: azure-devopsangular-cliangular9azure-devops-server-2019

解决方案


请添加continueOnError到您的任务:

- task: string  # reference to a task and version, e.g. "VSBuild@1"
  condition: expression     # see below
  continueOnError: boolean  # 'true' if future steps should run even if this step fails; defaults to 'false'
  enabled: boolean          # whether or not to run this step; defaults to 'true'
  timeoutInMinutes: number  # how long to wait before timing out the task
  target: string            # 'host' or the name of a container resource to target

或者在这里,如果您使用经典管道: 在此处输入图像描述

但是,我建议您摆脱此警告。


推荐阅读