升级到Visual 2015之后,“在保存上编译”功能对我不起作用。当我对项目中的.ts
文件进行更改并保存时,IDE底部的状态栏显示为Output(s) generated successfully
,但是生成的.js
文件不会改变。
以下是我尝试过的:
<Project>
True中向根.csproj
元素添加以下内容Tools -> Options -> TypeScript -> Project
文件”选项
我遗漏了什么?
顺便提一句,TypeScript编译步骤在由常规构建触发时确实可以正常工作。
发布于 2015-08-17 10:33:36
最近对TypeScript Language Services
扩展的更新似乎已经解决了这个问题。
有关如何应用此更新的说明,请参见See this answer。
发布于 2016-03-15 06:25:26
对我来说,这是tsconfig.json
中的一个选项
"compileOnSave": true,
"compilerOptions": { ... },
重新启动Visual以使此更改生效。
发布于 2017-06-01 03:39:55
解决方案:
对我来说,而且我确信其他人也是如此,这是由于tsconfig.json中的一个错误。
您需要添加"compileOnSave":true。但是在全局部分,而不是compilerOptions内部。
Wrong:
{
"compilerOptions": {
"noImplicitAny": false,
"noEmitOnError": true,
"removeComments": false,
"sourceMap": true,
"target": "es5",
"compileOnSave": true
},
"exclude": [
"node_modules",
"wwwroot"
]
}
Correct:
{
"compilerOptions": {
"noImplicitAny": false,
"noEmitOnError": true,
"removeComments": false,
"sourceMap": true,
"target": "es5"
},
"compileOnSave": true,
"exclude": [
"node_modules",
"wwwroot"
]
}
诚挚的问候,
安德斯和贝沙卡特。
https://stackoverflow.com/questions/31750964
复制