swc-project / swc-node

Faster ts-node without typecheck
MIT License
1.78k stars 75 forks source link

fix(register): support paths alias with baseUrl #666

Closed ghost closed 2 years ago

ghost commented 2 years ago

At the moment, swc-node raise an error if we defined paths in tsconfig.json

For example:

{
  "compilerOptions": {
    "baseUrl": "./src",
    "paths": {
         "@api/*": ["api/*"]
     }
  }
}
Error: Cannot find module '../../../../../api/http-service

This pull request is to convert options.paths to absolute paths

CLAassistant commented 2 years ago

CLA assistant check
All committers have signed the CLA.

joeledwardson commented 2 years ago

possible to get this merged pls?