egoist / esbuild-register

Transpile JSX, TypeScript and esnext features on the fly with esbuild
MIT License
990 stars 52 forks source link

fix: do not crash when project cli option is supplied #67

Closed swandir closed 2 years ago

swandir commented 2 years ago

Fixes #66

esbuild-register calls loadConfig from 'tsconfig-paths' without arguments.

https://github.com/egoist/esbuild-register/blob/e41493714fc89f8f67c5f44401aecd3ee6b6867a/src/tsconfig-paths.ts#L7

loadConfig uses a default for its cwd param

https://github.com/dividab/tsconfig-paths/blob/8a76c5c4c35b45bec67bd71b74ce0cf5cb12bb9f/src/config-loader.ts#L41

which is read from --project flag in process.argv

https://github.com/dividab/tsconfig-paths/blob/8a76c5c4c35b45bec67bd71b74ce0cf5cb12bb9f/src/options.ts

The fix is to supply cwd to loadConfig explicitly.

swandir commented 2 years ago

Hi @egoist, would you have time to take a look at this? It's kind of blocking us from upgrading. Would be cool to see the fix released. Thanks!

egoist commented 2 years ago

:tada: This PR is included in version 3.3.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

egoist commented 2 years ago

thank you for the patience 🥲