【发布时间】:2018-07-29 01:36:07
【问题描述】:
我没有找到适用于 Angular cli“ng build --watch”commapnd 的有效 Visual Studio Code tasks.json 定义。有人可以提供经过良好测试的定义吗?
要重现,尝试出现错误,然后修复它。错误将保留在“问题选项卡”中
还需要“ng lint”的任务定义。
这是我拥有的,但效果不佳。
{
"version": "2.0.0",
"tasks": [
{
"label": "ngBuildWatch",
"type": "shell",
"command": "ng",
"args": [
"build",
"--watch"
],
"isBackground": true,
"problemMatcher": {
"owner": "angular",
"severity": "error",
"fileLocation": "relative",
"background": {
"activeOnStart": true,
"beginsPattern": {
"regexp": "^\\s*(?:message TS6032:|\\d{1,2}:\\d{1,2}:\\d{1,2} (?:AM|PM) -) File change detected\\. Starting incremental compilation\\.\\.\\./"
},
"endsPattern": "/^\\s*(?:message TS6042:|\\d{1,2}:\\d{1,2}:\\d{1,2} (?:AM|PM) -) Compilation complete\\. Watching for file changes\\./ "
},
"pattern": [
{
"regexp": "ERROR in (.*)\\(",
"file": 1
},
{
"regexp": "\\((\\d+),(\\d+)\\):(.*)",
"line": 1,
"column": 2,
"message": 3
}
]
}
}
]
}
【问题讨论】:
标签: angular visual-studio-code