swc-project / swc-node

Faster ts-node without typecheck
MIT License
1.81k stars 76 forks source link

Fix source maps #857

Open KidkArolis opened 2 months ago

KidkArolis commented 2 months ago

Fixes https://github.com/swc-project/swc-node/issues/848 Improves upon the original fix in https://github.com/swc-project/swc-node/pull/726 that broke the source maps for non inline cases.

Note: only one of sourceMap or inlineSourceMap can be on at the same time in tsconfig, so this checks for inline, and if not set falls back to evaluating the sourceMap opiton.

on snapshot update

The snapshot is now correct. The correct line for the error is 30:5:

Error: ␊
at /packages/integrate/__tests__/sourcemaps/sourcemaps.spec.ts:30:5␊

This error is thrown in line 30 here: image

Would you like me to work on a dedicated test for testing inlineSourceMap? Didn't naturally fit into the current test suite, but could definitely whip something up.

CLAassistant commented 2 months ago

CLA assistant check
All committers have signed the CLA.