-
Notifications
You must be signed in to change notification settings - Fork 193
[Feature]: Option to inline web workers! #4762
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
Comments
The |
By the way, you can subscribe to this issue to get more discussions about |
@9aoy Hm, I'm so sorry for coming back late. Just tried your example, but unfortunately, its behavior is different from the built-in one, and it doesn't work with TypeScript. I know this question might be off-topic a bit, but is there a way to make your work with the TS worker files? I tried ts-loader which didn't work so I believe some other way should be used instead... (just in case I'm trying to make a working example of it here: https://github.com/zardoy/rsbuild-workers-repro any guidance would be appreciated :) Also, it seems that example doesn't work with js modules imported from node_modules either |
What problem does this feature solve?
Hello! Opening this issue for #3240 (comment)
Context
https://rsbuild.dev/config/output/inline-scripts#async-chunks says that
dynamicImportMode: 'eager'
should not generate async chunks anymore, however when importing workers likeIt still produces an HTML file and a single async chunk which is the worker.
Unfortunately I'm not good with understanding webpack options, but I also tried configuring loader like that (which also didn't work unfortunately)
What does the proposed API look like?
I think web workers should be inlined when dynamicImportMode = eager
Context: FYI in my case half of workers are generated by esbuild (yes I'm using npm-run-all) and I inline them manually, but now I'm in transition to rebuild and AFAIS it still doesn't support it. Thanks in advance!
The text was updated successfully, but these errors were encountered: