webpack - Debug lazy loaded Angular 2 module in Chrome / VS Code -
i using webpack angular 2/4 , using modules lazy loaded. therefore modules , components not included in main .js
file, code resides in 1 of files webpack generates counts up: 0.js
, 1.js
, on.
my problem neither chrome nor vs code can debug code within files reason. when include code main .js
file, debugging works fine. there can it?
example:
i have small directive displays local time in html element. use directive in component lazy loaded. when try debug directive (or else lazy loaded) vs code says following:
debugging not possible in chrome either. if use directive in root component (or else not lazy loaded) breakpoint working in vs code in chrome.
i tracked down files webpack generating main client , parts lazy loaded. each chunk of lazy loaded components located in files named 0.js
, 1.js
, on - , think here may cause of problem.
map files
the map files debugging generated accordingly, output:
look *.js.map file not created.
if using angular cli , fire ng build --prod build production , *.js.map file not generated if run ng build --dev generate *.js.map file.
if *.js.map file generated can able debug js code.
Comments
Post a Comment