Debugging an NPM module

2019-08-20 02:53发布

问题:

Currently, I've created an NPM module and published it to NPM and included it in a separate project for use. I've performed NPM link so I don't have to publish every time I make a change and those updates are being reflected appropriately. However, I can't seem to debug the module itself. I've tried placing a debugger in the modules code within the node_modules directory and I've tried to place one in the actual module project, but to no avail. Is there a best practice for debugging an NPM module? If it helps, I'm using Visual Studio Code.