我正在努力让Visual Studio Code将我的TypeScript编译为Javascript . 我在Visual Studio 2017中成功地使用了TS,但是我想我会尝试使用VS Code .
我已经运行了监视任务,终端输出中的最后一行是:
15:57:49 - Compilation complete. Watching for file changes.
但是,当我保存ts文件时,什么也没发生 . 再次,在VS2017中,它编译保存罚款 .
项目中有一些区域产生了很少的TS错误 - 这些区域是由其他人编写的,不属于我的项目范围 . 我想知道这些错误是否会停止编译?或者它应该仍然在逐个文件的基础上编译?
ts.config
{
"compilerOptions": {
"noImplicitAny": false,
"noEmitOnError": true,
"removeComments": false,
"sourceMap": true,
"target": "es5"
},
"compileOnSave": true,
"exclude": [
"node_modules",
"wwwroot",
"typings/ckeditor/ckeditor.d.ts",
"typings/ckeditor/index.d.ts",
"typings/lodash/lodash.d.ts"
],
"include": [
"**/*.ts"
]
}
Versions
VSCode 1.17.2
打字稿2.5.3
1 回答
"noEmitOnError": true
编译器选项可防止在发现typecriptcript错误时生成javascript .有关编译器选项的更多信息here