ignore debugger; statements in Node.js, during debug session

breakpoints, debugging, node.js

Solution

A trick I've used in the past is to just use babel to strip out debugger statements:

See: https://www.npmjs.com/package/babel-plugin-remove-debugger

Problem

I have a codebase where I have quite a number of ``` debugger; ``` statements. Sometimes I debug, and I actually just want to skip all of the debugger; statements and continue only to the manually set breakpoints that I have chosen for the debugging session, is there some setting by chance with Node.js to do that? In other words, I would like to consider the `debugger;` statements to be long-term placeholders, but for certain debugging sessions I would like to ignore those long-term placeholders.

Original source