swc: Support paths from tsconfig
The swc transpiler can support paths, but they have to be converted to absolute paths using the baseUrl first.
Hi maintainers, some more context in case it's not clear: tsconfig.json supports paths, but this wasn't wired into the ts-node swc transpiler. I wired this in using absolute paths (as recommended here)
Hi @cspotcode, I see you're also working on swc support in #1802. Assuming you see the value in this PR, how do think it should progress? I'm happy to help out if you would like it to go in as part of #1802.
@spmiller I came across this today. but here's a thing. we should not add a feature that is only available on swc. I think this feature is not supported by TypeScript official transpiler.
Hi @erfanium, thanks for looking at this patch.
The paths attribute is indeed supported by tsc (I linked to the config above) but ts-node wasn't passing this part of the config through to the swc compiler. Because of this, I don't think it's only available on swc, but perhaps I have misunderstood your point?
@spmiller I have made a tiny repo for you: https://github.com/erfanium/esm-ts-paths
in tsconfig file, either using swc: true to swc: false doesn't make it work. that means this feature is not supported by tsc even.
or maybe i am wrong