mat*_*key 6 electron visual-studio-code
我加载了yeoman generator-meanjs并用Visual Studio Code打开它.调试器工作得很好.当我单击调试侧栏按钮时,为我生成了launch.json文件.launch.json生成器正在查看包含的package.json "scripts": { "start": "grunt"}
.
生成器使用grunt来启动应用程序.launch.json文件具有以下内容:
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "node",
"request": "launch",
"program": "grunt",
"stopOnEntry": false,
"args": [],
"cwd": ".",
"runtimeExecutable": null,
"runtimeArgs": [
"--nolazy"
],
"env": {
"NODE_ENV": "development"
},
"externalConsole": false,
"sourceMaps": false,
"outDir": null
},
{
"name": "Attach",
"type": "node",
"request": "attach",
"port": 5858
}
]
}
Run Code Online (Sandbox Code Playgroud)
当我'program' : 'grunt'
用server.js 替换它时,它工作.如果我可以将类型更改为grunt,但似乎只支持节点或单声道.
我设法通过使用grunt-cli的绝对路径使其工作,如下所示:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Grunt",
"args": ["build"],
"program": "${env.APPDATA}\\npm\\node_modules\\grunt-cli\\bin\\grunt",
"stopOnEntry": true,
"cwd": "${workspaceRoot}"
}
]
}
Run Code Online (Sandbox Code Playgroud)
正如@ L.Butz指出的那样,在较新的vscode版本上,替换env.APPDATA
为env:APPDATA
.
归档时间: |
|
查看次数: |
4245 次 |
最近记录: |