Commit 37a9e99
authored
fix: Set source maps support via API (#181)
`env` on different systems behaves differently. On macOS,
`env ABC XYZ` will invoke ABC with argument XYZ.
On some Linux variants, you need `env -S ABC XYZ` for that.
On Alpine, the `-S` flag is not supported, and there is seemingly
no way of passing arguments.
So this patch undoes the accidental breakage in #179
and uses the `getSourceMapsSupport` API.
Technically, both `process.setSourceMapsEnabled` and
`module.setSourceMapsSupport` are experimental functions,
so to be safe, we do a dynamic existence check before calling
them for portability across Node versions.1 parent cb9c7be commit 37a9e99
1 file changed
+21
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
5 | 25 | | |
6 | 26 | | |
7 | 27 | | |
| |||
0 commit comments