【发布时间】:2016-09-12 21:57:34
【问题描述】:
我正在使用 Visual Studio Code (vscode),这是一个在 Visual Studio 2015 (VS Proper) 中初始化的 asp.net 核心项目。当我在 vscode 中设置它时,初始过程包括在 tasks.json 中添加这个自动生成的构建任务:
{
"version": "0.1.0",
"command": "dotnet",
"isShellCommand": true,
"args": [],
"tasks": [
{
"taskName": "build",
"args": [
"${workspaceRoot}\\project.json"
],
"isBuildCommand": true,
"problemMatcher": "$msCompile"
}
]
}
但我使用的是打字稿,所以我希望它能够编译。我在命令托盘中键入“配置任务运行程序”(仅在重命名 tasks.json 后,因为它创建了一个同名文件)并配置如下所示的打字稿任务:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "tsc",
"isShellCommand": true,
"args": ["-p", "."],
"showOutput": "silent",
"problemMatcher": "$tsc"
}
然后,当我构建时,我的打字稿被很好地编译,但我没有得到真正的“构建”......
不起作用的直观解决方案:
{
"version": "0.1.0",
"command": "dotnet",
"isShellCommand": true,
"args": [],
"tasks": [
{
"taskName": "build",
"args": [
"${workspaceRoot}\\project.json"
],
"isBuildCommand": true,
"problemMatcher": "$msCompile"
},
{
"taskName": "tsc",
"isBuildCommand": true,
"args": ["-p", "."],
"showOutput": "silent",
"problemMatcher": "$tsc"
}
]
}
如何在每次构建时同时执行这两个过程? 对我没有帮助的有希望的链接:
https://github.com/Microsoft/vscode/issues/981
How to define several typescript compile tasks in one tasks.json?
【问题讨论】:
标签: visual-studio typescript asp.net-core visual-studio-code