【发布时间】:2016-08-11 14:15:09
【问题描述】:
我有一个使用打字稿的 MVC 5 项目。
现在我必须实现新功能,我打开其他打字稿实现方式。
我正在尝试使用 typescript 1.8 的多个 tsconfig.json 文件新功能,我有两个文件夹:typescriptE21 和 typescript,每个文件夹上都有一个 tsconfig.json 文件。
第一个:
{
"compilerOptions": {
"removeComments": false,
"sourceMap": false,
"target": "es5",
"noImplicitAny": false,
"module": "amd",
"declaration": false,
"noEmitOnError": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"inlineSourceMap": true,
"inlineSources": true
},
"compileOnSave": true,
"exclude": [
"node_modules",
"typescript"
]
}
第二个:
{
"compilerOptions": {
"removeComments": false,
"sourceMap": false,
"target": "es5",
"noImplicitAny": false,
"module": "system",
"declaration": false,
"noEmitOnError": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"inlineSourceMap": true,
"inlineSources": true
},
"compileOnSave": true,
"exclude": [
"node_modules",
"typescript21",
"scripts"
]
}
当我在 Typescript 部分打开项目属性时,显示“检测到一个或多个 tsconfig.json 文件。项目属性已禁用。”这是正确的,但是当我运行应用程序时出现此错误:
Build: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning
关于这个文件:
import {Component} from "ngts/ngts";
@Component({
template: `<div md-scroll-y flex class="md-padding" id="contenido">Contenido</div>`
})
export class EmAplicacion {
}
在两个tsconfig.json 文件中,我都激活了装饰器,但打字稿似乎没有从那里获得编译器选项...
此外,当我不使用装饰器时,它可以编译,但我可以看到结果文件,并且当我将“系统”放入第二个配置文件时,它们是使用 AMD 模块系统发出的......
有什么问题?
【问题讨论】: