NodeJS remote debugging with folder map to local

I have source of NodeJS application in src folder. But in folder dist I have copied app from source folder (it is copy 1:1) via webpack (but I think, it doesn't matter in this situation).

I have a question. Is it possible to make break point in src folder, run application from dist folder and run debug properly?

I've tried as Remote Debugging. I can connect to "remote", but I can't make breakpoint in src folder. I have to make breakpoint from Debug console (Script tab) in dist folder.
It takes me much time to find file in tree.

I thought about Remote Host and map folder but it doesn't work.

0
4 comments

When debugging Node.js applications, such mappings are only possible using sourcemaps. If your 'copy' task can generate them, it should be enough

0
Avatar
Permanently deleted user

So source maps are required even src and dist folder are the same ? Just another folder.

Unfortunately I write node app without source maps and my "copy task" (webpack copy plugin) can't generate it.
Also I don't bundle my node app via webpack.

0

WebStorm can't know that they are the same, and it has no idea where to look for sources of the files that are being debugged - unless you provide some mappings. For debugging in browser, you can specify remote url mappings right in the debug configuration. For Node.js debugging, no URL mappings exist, so the only way to map files being executed to sources is providing sourcemaps

0
Avatar
Permanently deleted user

Ok.

Thank you for answer.

0

Please sign in to leave a comment.