egoist / esbuild-register

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

`getOptions` function doesn't account for `extends` in `tsconfig.json` #99

Open markacola opened 11 months ago

markacola commented 11 months ago

The getOptions function that uses joycon to load the tsconfig.json doesn't account for extends within the retrieved tsconfig.json file. This can result in the jsxFactory, jsxFragmnet, and target options not being set correctly, causing errors on importing a file with jsx in it.

I am happy to submit a PR with updates, but I wanted to confirm the desire for the change and the proposed fixes first.

The proposed update is to replace joycon resolution with a cut-down version of the ts compilers parseConfig function. This will be similar to what is implemented in the tsconfig-paths tsconfig-loader.ts file, but additionally accounting for node_modules directories in parent directories (emulating or using the node module resolution algorithm).

Let me know what you think.