javascript - How to implement error tracking in a polymer? -
is there way of error tracking in polymer?
problem apparently vulcanize , polybuild processes couldn't provide source-maps (please correct me if i'm wrong). means if catch exception in vulcanized java script code using global window.onerror
function not able map , find actual location of error in source files.
any solutions/workarounds highly appreciated.
here idea of done. please provide ideas , solutions aswell. solution not tested.
according https://github.com/polymerlabs/polybuild polybuild tool same as:
vulcanize --inline-css --inline-scripts --strip-comments index.html | polyclean | crisper --html index.build.html --js index.build.js
the order is:
1) vulcanize produces 1 html formatted file.
2) polyclean uses uglifyjs internaly , perform cleaning
3) crisper used separate uglyfied , minified js html
as far know uglifyjs doesn't work html files input polyclean manually cuts parts of js code', put through uglifyjs , paste (i hope understood correctly how polyclean works). that's why creating of source maps useless in context. idea change order of polyclean , crisper , modify polyclean allow using external options uglifyjs2:
new order:
1) vulcanize produces 1 html formatted file.
2) crisper used separate formatted js html.
3) polyclean uses uglifyjs internaly , perform cleaning (in case need use on both js , html files)
so first have html file , formatted js file , can use uglifyjs2(call polyclean or standalone?) --source-map , --source-map-include-sources options. can keep tracking errors using produced source-map contains formatted copy of js file produced in step #2.
Comments
Post a Comment