-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
upgrading from v3 to v4 breaks build for TS projects #343
Comments
|
Thanks for the quick reply! Apologies I accidentally made private repo. Fixed that. I hope the repo elaborates my issue better
|
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as off-topic.
This comment was marked as off-topic.
Feel free to open a PR |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
So after much testing, I think I understand a little bit more of how this is happening. If E.g. If you have a This may be a good warning for the sake of clarity, but it's also a little bit unexpected in my opinion. This was added in V4. https://github.com/privatenumber/esbuild-loader/releases/tag/v4.0.0 To immediately fix this, you can add the
Also here are two suggestions I'd propose. If @privatenumber agrees, I wouldn't mind contributing a PR to modify some things too.
|
I appreciate you contributing constructively! Here are the problems I see:
I'm open to the following PRs:
|
@privatenumber thanks for creating this plugin ! we ran into the same issue.
I'm wondering how does this relate to typescript incompatibility ? AFAIK the only source of truth for loading module tree within webpack is From my POV to resolve this processing issue of esbuild-loader any note: Also as you realised regarding program creation within TS, anything that is being part of Program is included in both type-checking and transpiling even if it's not specified within include/files pattern , even if it's within exclude patterns and it is part of your program it will be consumed. This behaviour is in TS since day 1 AFAIR. |
Yeah, I think I agree with you. It doesn't matter too much now... but originally, I was trying to handle cases with multiple tsconfigs. For example, a tsconfig for the But I see now I was misunderstanding TS behavior: TypeScript simply applies the tsconfig to all imported files even if only the entry-file is in Another interesting case is a monorepo where one packages bundles another with a different tsconfig. This is a problem we have in https://github.com/privatenumber/tsx too. Anyway, would you be willing to work on this? |
Problem
I've created the following repo for reproducing the issue: https://github.com/vritant24/webpack-esbuild-loader-4-repro
Steps:
npm install
npm run build
The build should succeed.
If you upgrade the
esbuild-loader
version in package.json to4.0.2
, you will see errors similar to:Expected behavior
Build should succeed
Minimal reproduction URL
https://github.com/vritant24/webpack-esbuild-loader-4-repro
Version
4.0.2
Node.js version
v16
Package manager
npm
Operating system
Windows
Contributions
The text was updated successfully, but these errors were encountered: