如何正确使用打字稿项目

时间:2017-05-25 22:18:40

标签: typescript visual-studio-code

我们正在使用vscode处理多个打字稿项目,我们不确定最好与它们一起工作,现在我们有一个配置如下的tasks.json:

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "0.1.0",
    "command": "./node_modules/.bin/tsc",
    "windows": {
        "command": "\"./node_modules/.bin/tsc\""
    },
    "isShellCommand": true,
    "args": ["-w", "-p", "."],
    "showOutput": "always",
    "problemMatcher": "$tsc-watch"
}

但是这样做我们每次打开一个项目时都必须用cmd+shift+b启动任务。

有没有办法自动启动?

它不必使用task.json它可以是其他东西。

1 个答案:

答案 0 :(得分:1)

不是开箱即用,但你可以使用插件Blade Runner,它会在你每次打开文件夹时执行你的构建命令。