我正在尝试在VS Code中为基于Aurelia CLI的应用程序实现"F5"调试.Aurelia CLI基于Gulp任务构建.我想设置一个运行的任务,au run --watch并在按"F5"进行调试时启动此任务("启动Chrome"选项).
为au run --watch命令创建基本任务很简单.
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "au",
"isShellCommand": true,
"tasks": [
{
"taskName": "watch",
"suppressTaskName": true,
"args": [
"run",
"--watch"
],
"isBuildCommand": false,
"isBackground": true
}
]
}
Run Code Online (Sandbox Code Playgroud)
然后,当我按F5将其添加到"启动针对localhost的Chrome"调试配置时,我可以启动此任务:
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:9000",
"webRoot": "${workspaceRoot}",
"preLaunchTask": "watch"
}
Run Code Online (Sandbox Code Playgroud)
我看到的问题是,由于此任务是一项无法完成的"监视"任务,因此代码永远不会启动Chrome选项卡或启动调试会话.
我已经尝试在我的任务配置中添加了"problemMatcher",但坦率地说,此功能的文档有点稀疏.我得到的错误输出似乎与JSON模式所说的不一致.希望有人可以帮助我.这是我当前的非工作任务配置.当我说非工作时,我的意思是任务成功运行,但VS Code没有注意到任务的观看部分已经开始.
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about …Run Code Online (Sandbox Code Playgroud) 我已经numeral.js通过npm 安装并添加aurelia.json到供应商包中,然后我从值转换器中使用它:
import numeral from 'numeral';
export class CurrencyValueConverter {
toView(value) {
return numeral(value).format('$0,0.00')
}
}
Run Code Online (Sandbox Code Playgroud)
我收到以下错误 TypeError: numeral_1.default is not a function