【发布时间】:2015-09-02 18:27:07
【问题描述】:
使用Ctrl+Shift+B我添加了一个默认的tasks.json文件并取消了第二个任务运行块的注释。我在目录的根目录中有一个打字稿文件和一个 tsconfig.json。
每次编译时都会收到“错误 TS5023:未知编译器选项“p”。允许我编译打字稿文件的正确定义是什么?子目录下的所有文件都可以一次编译吗?
我尝试将下面的 args 更改为 ["${file}"],这仅允许我编译打开的文件。这行得通。我还从命令提示符运行了 tsc 命令,并且不存在 -p 或 -project 参数。
tasks.json
{
"version": "0.1.0",
// The command is tsc. Assumes that tsc has been installed using npm install -g typescript
"command": "tsc",
// The command is a shell script
"isShellCommand": true,
// Show the output window only if unrecognized errors occur.
"showOutput": "silent",
// Tell the tsc compiler to use the tsconfig.json from the open folder.
"args": ["-p", "."],
// use the standard tsc problem matcher to find compile problems
// in the output.
"problemMatcher": "$tsc"
}
tsconfig.json
{
"compilerOptions": {
"target": "ES5",
"module": "amd",
"sourceMap": true
}
}
VS 代码:v0.30
TypeScript:v1.4
【问题讨论】:
标签: typescript visual-studio-code