How to debug “webpack.config.js” file?

Simply run webpack.js in debug mode using nodejs. You can run the following on your terminal (assuming you are already in the directory with your node_modules present):

node --inspect node_modules/webpack/bin/webpack.js --colors

I also found the VSCode debugger very intuitive for debugging when I was developing my own webpack loader. If you use VS Code you can have your launch.json have the following configuration:

{
        "type": "node", 
        "request": "attach",
        "name": "Attach",
        "port": 5858
}

Then run the node-inspector with the following command:

node --inspect-brk=5858 node_modules/webpack/bin/webpack.js --colors

Finally, run the debug configuration by going to the debug tab, pick your configuration at the top, and then press the run configuration button.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)