Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Azure lerna monorepo中的vscode启动功能应用程序_Azure_Visual Studio Code_Vscode Debugger_Lerna_Monorepo - Fatal编程技术网

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扩展名,它可以帮助您在处理基于正则表达式和颜色的服务器端文件和客户端文件时轻松区分。也许对你有帮助!