Originally reported on Google Code with ID 2423
Say you're developing a complex web app with many JS files. You will
typically serve your page with your JS files merged into one or two files
for loading efficiency.
It would be nice if Firebug had some way of detecting this and reporting JS
errors with the *original* file's URL and the *original* file's line
numbers, rather than the line numbers in the honking concatenated file.
[NOTE: I understand that minifying the merged JS files makes this idea
untenable, but I think it is still worthwhile to solve the problem for
development mode -- I use merged but unminified concatenated files for
development all the time].
One way to do this would be to have special directives in the merged files
which specify where each original file starts, along with its URL.
For example, each new file merged into the concatenated file could start
with a comment:
/*** Merged from: http://path/to/originalFile.js ***/
...
/*** Merged from: http://path/to/someOtherFile.js ***/
...
Then when firebug is reporting errors, it could note that this is a merged
file and report the error as coming from the URL of the original file, with
the line number relative to the "Merged from" comment.
Note that I'm not attached to that particular method of signalling where
files begin -- we can probably come up with something better.
I'm happy to write JS to support this, but am not familiar with coding in
Firebug so if someone is willing to help shepherd me in implementing this,
I'm game.
I'm going to stop here and see if there's any reaction to this. If anyone
is interested in working on this or needs more details, please note in the
bug and I'll write more as necessary.
Reported by owenoak on 2009-10-24 19:40:19
该提问来源于开源项目:firebug/firebug