【发布时间】:2019-04-30 14:35:58
【问题描述】:
我正在使用 TypeScript,并且经常不得不手动启动 tsc-watch 任务。根据博客 VSCode v1.30+ 可以automatically run tasks when a folder is opened 但这对我不起作用(v1.33.1) - 我打开我的文件夹并且没有任务正在运行。
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"type": "typescript",
"tsconfig": "tsconfig.json",
"isBackground": true,
"problemMatcher": [
"$tsc"
]
},
{
"type": "typescript",
"label": "TypeScript Compiler Watcher Thingy...",
"tsconfig": "tsconfig.json",
"option": "watch",
"problemMatcher": [
"$tsc-watch"
],
"runOptions": {
"runOn": "folderOpen"
}
}
]
}
顺便说一句:也试过this extension,它也没有启动任务。
【问题讨论】:
-
当您第一次使用该任务配置打开任务时,它会提示您授予自动运行任务的权限。您可能不小心点击了“否”。尝试运行命令“允许文件夹中的自动任务”
-
我对“tsc watch”2019.11也有同样的问题
-
有没有人找到可行的解决方案???
-
Ctrl+SHIFT+P和Tasks: Manage Automatic Tasks in Folder并选择Allow Automatic Tasks in folder并重新启动 VS Code
标签: visual-studio-code vscode-tasks