【问题标题】:Can Azure compile TypeScript and execute Gulp tasks?Azure 可以编译 TypeScript 并执行 Gulp 任务吗?
【发布时间】:2016-12-05 14:48:48
【问题描述】:

我正在使用 TypeScript + Angular 2 开发 .NET Core 应用程序。我想在 Azure 上部署它。当我这样做时,在 Azure 从我的存储库获取代码后,我看到以下构建错误:

“VSSTC:错误 TS5023:构建:未知编译器选项 'lib'。[D:\home\site\repository\AC.API\AC.API.xproj]”

我的tsconfig.json 正在关注:

  {
  "compileOnSave": true,
  "compilerOptions": {
    "noImplicitAny": true,
    "noEmitOnError": true,
    "sourceMap": true,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "module": "commonjs",
    "moduleResolution": "node",
    "removeComments": false,
    "target": "es5",
    "lib": [
      "es2015",
      "es5",
      "dom"
    ]
  },
  "include": [
    "app/**/*.ts"
  ]
}

本地一切正常。如果我删除 tsconfig.json 中的“lib”部分,我无法在本地编译解决方案。

所以,我有一些问题。 Azure 可以编译 TypeScript 并执行 Gulp 任务吗?如何更改 Azure 上的 TypeScript 版本?或者我该如何解决我的问题?

【问题讨论】:

  • 我很确定您可以在持续集成和部署中做到这一点。你绝对可以在 Visual Studio Team Service 中做到这一点。

标签: azure typescript gulp asp.net-core


【解决方案1】:

不,您不能,因为 Azure 只是托管您的 Web 应用程序的云服务,因此您必须管理构建中的编译过程,例如 Azure Devops 中的 Continus 集成,并使用其发布管道将代码部署到 Azure。

您可以在here找到详细信息

希望对您有所帮助。

【讨论】:

    猜你喜欢
    • 2021-05-22
    • 1970-01-01
    • 1970-01-01
    • 2021-12-14
    • 1970-01-01
    • 2015-10-18
    • 1970-01-01
    • 2018-03-13
    • 2015-09-01
    相关资源
    最近更新 更多