Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolve hook doesn't respect tsconfig's compilerOptions #2265

Open
hardfist opened this issue May 25, 2022 · 2 comments
Open

resolve hook doesn't respect tsconfig's compilerOptions #2265

hardfist opened this issue May 25, 2022 · 2 comments
Labels

Comments

@hardfist
Copy link
Contributor

hardfist commented May 25, 2022

It seems that esubuild's buitin resolve will return more information about tsconfig than resolve hook, which will affect transform result such as UseDefineForClassFields
https://github.com/evanw/esbuild/blob/master/internal/bundler/bundler.go#L788-L810 resolve hook doesn't support return anything about tsconfig. you can see difference in the demo here https://github.com/hardfist/esbuild-bug/tree/main

we can fix this if we support pass compilerOptions to esbuild directly other than rely on resolve result about tsconfig(which seems rarely useful and inefficient for real world case and rollup and webpack doesn't support this)

@evanw
Copy link
Owner

evanw commented May 26, 2022

Yes, this is currently a limitation of the plugin API. One problem is that esbuild's internals read this information in the resolver for performance, but this does not make for a good plugin API so it has not been exposed. Perhaps your suggestion should be how the existing tsconfig option works.

@hardfist
Copy link
Contributor Author

yes,i think support multi tsconfig is kind of odd and complex,it would be better if we can configure compiler options only by option or root tsconfig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants