【发布时间】:2018-11-20 20:49:57
【问题描述】:
首先,我有一个结构如下的 monorepo:
repo-name/
packages/
backend/
frontend/
.vscode/
后端是一个 Azure 函数应用,其结构如下:
backend/
functions/
funcOne/
funcTwo/
scripts/
start-debug.sh
package.json
其次,对于backend的package.json,我有一个脚本:
"debug": "npm run build && FUNCTION_APP_PORT=7071 ./scripts/start-debug.sh",
start-debug.sh 脚本如下所示:
#!/bin/bash
set -e
cd ./functions
func extensions install
func host start -p $FUNCTION_APP_PORT --debug VSCode
我正在尝试编写启动配置,以便可以在 VSCode 中调试我的函数。
根据我在那里的发现,我尝试了许多变体,但似乎没有任何效果。有没有人有什么建议?
这是我最近的尝试:
{
"name": "Launch Backend Functions",
"type": "node",
"request": "launch",
"address": "localhost",
"protocol": "inspector",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/lerna",
"runtimeArgs": [
"exec",
"--scope",
"actual-name-of-backend-package",
"--",
"npm"
],
"args": ["run", "debug"],
"port": 1234
}
【问题讨论】:
-
嘿,我编写了一个小的 vscode 扩展,可以帮助您在处理基于正则表达式和颜色的服务器端文件和客户端文件时轻松区分。也许对你有帮助! marketplace.visualstudio.com/…
标签: azure visual-studio-code vscode-debugger lerna monorepo