felixge / node-sandboxed-module

A sandboxed node.js module loader that lets you inject dependencies into your modules.
MIT License
342 stars 42 forks source link

Source maps for source transformers #43

Open OliverJAsh opened 9 years ago

OliverJAsh commented 9 years ago

Errors originating from source that has been transformed do not have correct mappings in their stack trace. I believe this is because when source is transformed, no source map can be provided.

Could we allow a source map to be passed and then rewrite all call stacks?

domenic commented 9 years ago

That sounds ambitious, but if you can think of an approach, pull request welcome. It would have to be off by default for performance I think?

The source-map-support package seems useful for this. In fact, it might be possible to just use that without any changes to sandboxed-module... if so we could add something to the readme explaining how.