It turns out that we can put the source map comment into evaled code and devtools do recognize it. This should not present in the final build, so I think the resulting code should be made obvious that the source map is in use, like this:
eval(Function(/* compressed data here */)(...)+'\n//# sourceMappingUrl=foo.js.map')
We would have to preserve the existing sourceMappingUrl comment and update it (and also sourceURL) if the JS preprocessing is in use.
It turns out that we can put the source map comment into
eval
ed code and devtools do recognize it. This should not present in the final build, so I think the resulting code should be made obvious that the source map is in use, like this:We would have to preserve the existing
sourceMappingUrl
comment and update it (and alsosourceURL
) if the JS preprocessing is in use.