我们有一个使用TypeScript和Angular2的大型Web应用程序,它在本地运行良好。
因为我们在Azure上部署它时遇到了问题,所以我们使用模板创建了一个简单的Angular2应用程序。此应用程序只显示着名的Hello World
。
我们使用Visual Studio Team Services作为我们的GIT回购。我们还使用Continuous Build,因此在提交时,Azure会编译并构建我们的应用程序。
我们现在正在让Azure将我们的TypeScript文件转换为JavaScript。
我们尝试了很多选项,但现在却遇到了这些错误:
[..]/AppData/npm/node_modules/typescript/lib/lib.es6.d.ts(17,14): error TS2300: Duplicate identifier 'PropertyKey'.
[..]/AppData/npm/node_modules/typescript/lib/lib.es6.d.ts(237,5): error TS2300: Duplicate identifier 'EPSILON'.
[..]/AppData/npm/node_modules/typescript/lib/lib.es6.d.ts(272,5): error TS2300: Duplicate identifier 'MAX_SAFE_INTEGER'.
[..]/AppData/npm/node_modules/typescript/lib/lib.es6.d.ts(279,5): error TS2300: Duplicate identifier 'MIN_SAFE_INTEGER'.
[..]/AppData/npm/node_modules/typescript/lib/lib.es6.d.ts(565,5): error TS2300: Duplicate identifier 'done'.
[..]/AppData/npm/node_modules/typescript/lib/lib.es6.d.ts(566,5): error TS2300: Duplicate identifier 'value'.
[..]/AppData/npm/node_modules/typescript/lib/lib.es6.d.ts(795,5): error TS2300: Duplicate identifier 'flags'.
[..]/AppData/npm/node_modules/typescript/lib/lib.es6.d.ts(823,5): error TS2300: Duplicate identifier 'size'.
[..]/AppData/npm/node_modules/typescript/lib/lib.es6.d.ts(833,5): error TS2300: Duplicate identifier 'prototype'.
[..]/AppData/npm/node_modules/typescript/lib/lib.es6.d.ts(849,5): error TS2300: Duplicate identifier 'prototype'.
[..]/AppData/npm/node_modules/typescript/lib/lib.es6.d.ts(861,5): error TS2300: Duplicate identifier 'size'.
[..]/AppData/npm/node_modules/typescript/lib/lib.es6.d.ts(871,5): error TS2300: Duplicate identifier 'prototype'.
[..]/AppData/npm/node_modules/typescript/lib/lib.es6.d.ts(886,5): error TS2300: Duplicate identifier 'prototype'.
[..]/AppData/npm/node_modules/typescript/lib/lib.es6.d.ts(1282,5): error TS2300: Duplicate identifier 'prototype'.
typings/globals/es6-shim/index.d.ts(3,14): error TS2300: Duplicate identifier 'PropertyKey'.
typings/globals/es6-shim/index.d.ts(6,5): error TS2300: Duplicate identifier 'done'.
typings/globals/es6-shim/index.d.ts(7,5): error TS2300: Duplicate identifier 'value'.
typings/globals/es6-shim/index.d.ts(245,5): error TS2300: Duplicate identifier 'EPSILON'.
typings/globals/es6-shim/index.d.ts(280,5): error TS2300: Duplicate identifier 'MAX_SAFE_INTEGER'.
typings/globals/es6-shim/index.d.ts(287,5): error TS2300: Duplicate identifier 'MIN_SAFE_INTEGER'.
typings/globals/es6-shim/index.d.ts(343,5): error TS2300: Duplicate identifier 'flags'.
typings/globals/es6-shim/index.d.ts(495,5): error TS2300: Duplicate identifier 'prototype'.
typings/globals/es6-shim/index.d.ts(558,5): error TS2300: Duplicate identifier 'size'.
typings/globals/es6-shim/index.d.ts(567,5): error TS2300: Duplicate identifier 'prototype'.
typings/globals/es6-shim/index.d.ts(578,5): error TS2300: Duplicate identifier 'size'.
typings/globals/es6-shim/index.d.ts(588,5): error TS2300: Duplicate identifier 'prototype'.
typings/globals/es6-shim/index.d.ts(603,5): error TS2300: Duplicate identifier 'prototype'.
typings/globals/es6-shim/index.d.ts(617,5): error TS2300: Duplicate identifier 'prototype'.
这些错误出现在构建日志中,当我使用Kudo控制台在de wwwroot中运行tsc
时。
至少这意味着Azure正在尝试转换我们的文件。但有些地方我们的配置错误。
wwwroot/tsconfig.json
的内容:
{
"compilerOptions": {
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"module": "commonjs",
"noEmitOnError": true,
"noImplicitAny": false,
"outDir": "public/",
"removeComments": false,
"sourceMap": true,
"target": "es6"
},
"exclude": [
"node_modules",
"typings/modules",
"typings/index.d.ts"
]
}
我们需要更改什么来传递这些错误?
一个侧面问题是:Azure表示构建和部署成功但日志显示错误且仅部分部署。如何在转换错误时告诉Azure不要继续?