我有一个使用打字稿的 MVC 5 项目。现在我必须实现新功能,我打开其他打字稿实现方式。我正在尝试使用tsconfig.json
typescript 1.8 的多文件新功能,我有两个文件夹: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 模块系统发出的......
有什么问题?