Let's perform the following steps to set up debugging for our Express application with Jetbrain's WebStorm IDE:
- First, we will update our NPM debug script in our project's package.json configuration. This time, we will simply add a $NODE_DEBUG_OPTION placeholder to our configuration. This placeholder will be populated by WebStorm based on its own Debug configuration when it launches the process:
{ ... "scripts": { "clean": "rimraf ./dist", "start": "node $NODE_DEBUG_OPTION ./dist/express.bundle.js", "debug": "DEBUG=express* node $NODE_DEBUG_OPTION ./dist/express.bundle.js", "build": "webpack", "watch": "npm-run-all clean build --parallel watch:server watch:build --print-label", "watch:build": "webpack --watch", "watch:server" ...