evanw / evanw/node-source-map-support

are base64 dataurl's supported in sourceMappingURL?

Open
#100 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.2k
Forks
223
PR merge metrics
No merged PRs in 30d

Description

Does node-source-map-support support inline sourcemaps encoded into data url's?

I'm writing ansible modules in javascript using webpack to package the javascript together into a standalone file. Ansible module's can be written in any language but must be contained in a single file -- hence the usage of webpack to run code on node ... It sounds strange perhaps, but its actually perfect for my usage and works well -- the only annoying thing is I haven't been able to get source-map to work for stack traces ...

Here's a simple example:

Input source:

```
require("source-map-support").install()

console.log("Hello");

throw Error("give me stack trace!")
```

And here's a gist showing what the webpack compiled version of the above src looks like ...

https://gist.githubusercontent.com/breathe/debf645ae49e5bd66768/raw/bab77313c1fde689645ff40e3b09fb768a3fb8b9/debug-sourcemap

Running the code in the gist above yields this output ... Any ideas?

```
Hello
Error: give me stack trace!
at Error (native)
at Object.eval (eval at (/Users/ncohen/software/ansible/sts-infrastructure/library/debug-sourcemap:49:2), :7:7)
at Object.0 (/Users/ncohen/software/ansible/sts-infrastructure/library/debug-sourcemap:49:2)
at __webpack_require__ (/Users/ncohen/software/ansible/sts-infrastructure/library/debug-sourcemap:21:30)
at /Users/ncohen/software/ansible/sts-infrastructure/library/debug-sourcemap:41:18
at Object. (/Users/ncohen/software/ansible/sts-infrastructure/library/debug-sourcemap:44:10)
at Module._compile (module.js:430:26)
at Object.Module._extensions..js (module.js:448:10)
at Module.load (module.js:355:32)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.