当我保存时,我无法让visual studio将typescript编译为js。当tsconfig.json在项目中时,保存时的Typescript编译不工作
我有一个xproj(净框架asp.net核心) 打字稿2.0.3工具为Visual Studio 2015年更新3
我试图启用tsconfig.json "watch" : true
但它表示当前主机不受支持。
我去工具>选项>文本编辑器>打字稿>项目并启用了“自动编译打字稿文件不属于项目的一部分”
尽管如此,.ts文件的变化将体现在.js文件中仅在编译期间,但只有在编译的c#服务器端文件发生更改时才会生效。
编辑:我已经知道在项目目录中tsconfig.json的简单存在将防止保存编译,即使配置文件为空。
现在可以修正某种方式吗?
这是我tsconfig.json的内容:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false,
"diagnostics": true
},
"include": [
"**/*.ts"
],
"exclude": [
"node_modules"
]
}
编辑2:我也尝试:
{
"compileOnSave": true,
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false,
"diagnostics": true
},
"filesGlob": [
"**/*.ts"
],
"exclude": [
"node_modules"
]
}
,并没有做任何事情。
我有完全相同的问题。此外,自安装Update 3和Typescript 2.0.3以来,智能感知不再有效。任何人都有解决方案? – Bluesight