felixge / node-sandboxed-module

A sandboxed node.js module loader that lets you inject dependencies into your modules.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Source maps for source transformers

OliverJAsh opened this issue · comments

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?

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.