Skip to content

Commit

Permalink
Detect node config for ignoring debugger ports (metalbear-co#159)
Browse files Browse the repository at this point in the history
* add NodeInspector debugger type for mirrord to detect ports

* Add changelog

* Fix config type
  • Loading branch information
gememma authored Dec 19, 2024
1 parent 56f78dd commit 99af734
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.d/+node-inspector-debugger-type.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added debugger port detection type for the node `--inspect`, `--inspect-wait` and `--inspect-brk` flags
4 changes: 4 additions & 0 deletions src/debugger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ async function main(
config.env["MIRRORD_DETECT_DEBUGGER_PORT"] = "debugpy";
} else if (config.type === "java") {
config.env["MIRRORD_DETECT_DEBUGGER_PORT"] = "javaagent";
} else if (config.type === "pwa-node") {
// if any of the --inspect flags are used with node, the port for inspection should be ignored
// see: https://nodejs.org/en/learn/getting-started/debugging#enable-inspector
config.env["MIRRORD_DETECT_DEBUGGER_PORT"] = "nodeinspector";
}

// Add a fixed range of ports that VS Code uses for debugging.
Expand Down

0 comments on commit 99af734

Please sign in to comment.