3 ms·
The one thing that keeps me from using browserify or webpack or the likes, is dev time debugging. It's not very useful to find that line 13729 of script.js thre
by skrebbel 13y ago
The one thing that keeps me from using browserify or webpack or the likes, is dev time debugging. It's not very useful to find that line 13729 of script.js threw an exception.
Source maps may help, but many browsers don't support them, and I want to be able to debug everywhere. Plus, when the browserified js actually came from Coffeescript or TypeScript or the likes, I already have source maps in place. Can browserify source map my source maps?
Is there a solution to this? How do browserify fans do this?
I guess what I'd like is for browserify to have a mode that removes the require()s from my .js files and generates a bunch of script tags in the right order.
- jonpacker 13y agoWell, source maps are usually the solution for me. And yes, browserify supports source-mapping all the way back to coffeescript files using browserify-middleware. In the off case that I need to debug something in a browser that doesn't support source maps, you can turn minifying off and usually it is pretty easy to recognise the code you're inspecting, even if it comes from coffeescript. I've never had a case where I've been completely out of luck (usually this case only happens in IE).
- indolering 13y agoUnable to find the link/name at the moment but there is a method (it isn't vanilla source-map) for this which basically wraps the modules into self-executing functions and it shows up in Firefox and Chrome as distinct files. It was related to source-map but not However, I have found Chrome and Firefox's support to be buggy.
- WickyNilliams 13y agosourceURL? You can even do it with functions in the console: function hello() { console.log("hello world"); //# sourceURL=hello.js } This will then appears in the sources panel under the name "hello.js". Which is great for debugging little scripts you're putting together in the console as you can set breakpoints, watches etc
- pyre 13y agoMaybe you're thinking of webmake. The sourceURL lines that it uses in the eval() sections resolve correctly on Chrome, but Firefox+Firebug don't seem to work for me. The webmake site references a bug in Firebug that was resolved ~1 year ago, but I still have issues it with. I end up swapping back and forth between Firefox+Firebug and Chrome to get all of the debugging features that I want.