How to do it...

Let's perform the following steps to set up debugging for our Express application with Jetbrain's WebStorm IDE:

  1. 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" ...

Get MEAN Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.