node.js - Is there any way to load files to Chrome when debugging node scripts -
currently it's possible debug node scripts using chrome described here. however, if run this:
node --inspect --debug-brk myscript it load myscript browser , i'll able put breakpoints in file. suppose myscript requires anotherscript , want put breakpoint in script. don't see how can done since chrome inspector loaded myscript.
is there way load file chrome inspector before files required in script , chrome loads itself?
i'm modifying sources , put debugger; statement there works. thinking should more apt purpose.
it seems it's not possible.
one possible solution avoid modifying sources put breakpoint @ end of script. in way chrome time breakpoint reached , execution paused chrome have loaded relevant files. can open file using ctrl+p , put breakpoint there. chrome keeps breakpoints between sessions if use open dedicated chrome devtool node option:
then restart node application. see more details in this make more efficient @ debugging webpack unspecified build errors article.

Comments
Post a Comment