-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Worker does not go through some plugins in vite build, but does in development #7569
Comments
Vite would think I think you want got a worker url for Vite, but now maybe can not. |
@poyoho thanks for your reply :)
It's not a maybe, it's a certain ;) Do you think pull request #7706 will have ay effect? |
no, it will make a dynamic import to be a chunk instead of worker assets. |
This hacky workaround works. |
@sapphi-red Thanks a lot! Did you have a look at my use case (https://github.com/stereokai/vite-test)? Thanks |
Sorry I meant a workaround to get a worker url. const workerpoolImportDev = `
importScripts("/node_modules/workerpool");
`;
let workerpoolImportProd;
try {
workerpoolImportProd = `
import workerpool from "workerpool";`;
} catch (e) {} |
@sapphi-red thanks, though what do you mean exactly by almost working? And can you please explain your change of |
@sapphi-red @poyoho Did you try out the test repo I set up? Thanks :) |
Describe the bug
In a Vite project with some Rollup plugins, when importing a worker like this: new URL("./worker/CompiledWorker.js", import.meta.url).href, the inlined code doesn't get transformed through some plugins when running
vite build
. I tried setting the plugins both directly on Vite and also on Rollup. See repo.Reproduction
https://github.com/stereokai/vite-test
System Info
Used Package Manager
pnpm
Logs
Validations
The text was updated successfully, but these errors were encountered: