
For example, if you have multiple configuration files you could pass -config to specify the configuration you'd like to debug. Also, don't forget that you can still pass arguments to the script. We recommend using the -inspect-brk flag which will break on the first statement of the script allowing you to go through the source to set breakpoints and start/stop the build as you please. You can also check out the NiM extension, a handy Chrome plugin that will automatically open a DevTools tab every time you -inspect a script. Click the "inspect" link under each script to open a dedicated debugger or the Open dedicated DevTools for Node link for a session that will connect automatically. Chrome DevTools introduced new features that help debug these key.

Now jump to chrome://inspect in the browser and you should see any active scripts you've inspected under the Remote Target header. You can run Lighthouse in Chrome DevTools, from the command line, or as a Node module.
#Cli option to debug node script in chrome devtools full
npm run build, so we'll have to specify the full node_modules path: node -inspect. Note that we cannot run npm scripts, e.g. Let's start by invoking webpack with the node -inspect.

As of Node v6.3.0+, developers can use the built-in -inspect flag to debug a node program in DevTools. As most front-end developers already know, Chrome DevTools are a life saver when debugging web applications, but they don’t have to stop there. While console statements may work well in straightforward scenarios, sometimes a more robust solution is needed. On top of that, the official analyze tool and various others will accept this data and visualize it in various ways.
