I want to debug the "webpack.config.js" file, not the application using "devtool: 'source-map'". I want the webpack configuration file to be debuged. Is there any option?
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. 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.
Webpack provides the devtool option to enhance debugging in the developer tool just creating a source map of the bundled file for you. This option can be used from the command line or used in your webpack. config. js configuration file.
Open any web site. Open developer tools in chrome by pressing F12 /Ctrl + Shift + I/ right-click anywhere inside the web page and select Inspect/Inspect Element which will be mostly the last option. Go to Sources tab in developer tools and open any minified JS which you want to debug as shown in the image.
The webpack configuration file webpack. config. js is the file that contains all the configuration, plugins, loaders, etc. to build the JavaScript part of the NativeScript application. The file is located at the root of the NativeScript application.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With