-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
fix(plugin-legacy): fix legacy plugin not working in worker context #19079
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is correct. The worker entry chunks are not legacy chunks.
Okay, I'll change it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this change will make the built application error in runtime because the legacy plugin does not transpile the worker content. I think we need to
- show an warning if a worker is used when legacy chunks are generated
- [optional] avoid injecting
__vite_legacy_guard
to worker chunks so that workers work in that case
The ideal fix is to generate legacy chunks for workers. But that's hard to do.
|
I guess this PR would make esbuild to transform I haven't tested, but this reproduction probably won't work on Chrome 45 because |
Oh, I noticed that the reproduction of #19073 is passing plugin-legacy to vite/packages/plugin-legacy/src/index.ts Line 255 in 282496d
|
closes #19073