Azure lerna monorepo中的vscode启动功能应用程序
首先,我有一个单回购协议,其结构如下:Azure lerna monorepo中的vscode启动功能应用程序,azure,visual-studio-code,vscode-debugger,lerna,monorepo,Azure,Visual Studio Code,Vscode Debugger,Lerna,Monorepo,首先,我有一个单回购协议,其结构如下: repo-name/ packages/ backend/ frontend/ .vscode/ backend/ functions/ funcOne/ funcTwo/ scripts/ start-debug.sh package.json 后端是一个Azure功能应用程序,其结构如下: repo-name/ packa
repo-name/
packages/
backend/
frontend/
.vscode/
backend/
functions/
funcOne/
funcTwo/
scripts/
start-debug.sh
package.json
后端是一个Azure功能应用程序,其结构如下:
repo-name/
packages/
backend/
frontend/
.vscode/
backend/
functions/
funcOne/
funcTwo/
scripts/
start-debug.sh
package.json
其次,对于后端的包.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中对我有效的启动配置:
{
"type": "node",
"request": "attach",
"name": "Attach by Process ID",
"protocol": "legacy",
"processId": "${command:PickProcess}",
"port": 9229
},
我的脚步很快
1) 转到我的后端
repo,然后运行运行我的start debug.sh
脚本的npm run debug
2) 在VS代码中,我附加到azure函数核心工具中的nodejsWorker
现在,我可以逐步完成我的函数。嘿,我已经编写了一个小的vscode扩展名,它可以帮助您在处理基于正则表达式和颜色的服务器端文件和客户端文件时轻松区分。也许对你有帮助!