I have a build script that runs all my code through uglifyjs, does a bunch of fancy caching stuff, and ultimately runs eval( code )
on some JavaScript files.
I had a similar problem and the solution seem to be using an inlined SourceMaps (DataURL of a SourceMap).
Here is an example:
eval("blah blah\n//@ sourceMappingURL=data:application/json;base64,...");
Seems like you can't reference external resources from an eval.
I think you also need to use sourcesContent
to insert the source code into the SourceMap.
Tested with Chrome 32.