-
Notifications
You must be signed in to change notification settings - Fork 120
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
[Feature]: Inline async JS chunks when using inlineScripts: true
#3240
Comments
About the web worker part: it seems rsbuild doesn't support bundling it. I'm coming from Vite which supports these imports: https://v3.vitejs.dev/guide/features.html#import-with-query-suffixes import MyWorker from './worker?worker&inline'
const worker = new MyWorker() |
Rspack provides a module.parser.javascript.dynamicImportMode option to avoid generating async chunks of dynamic imports: export default {
output: {
inlineScripts: true,
},
tools: {
rspack: {
module: {
parser: {
javascript: {
dynamicImportMode: 'eager',
},
},
},
},
},
}; |
Thanks a lot for a quick response and improving the docs by a lot! |
Yeah webworker inlining is another issue and we should provide a guide for it |
What problem does this feature solve?
Hi! I want to create a single-file HTML file so everything is inline into one HTLM file. As far as I can say everything works good (all assets & styles are inlined without any problems), but not async js chunks. Maybe it's just docs, but the docs of
inlineScript
say:Howerver when importing web workers and other modules with
import('...')
it always creates a second JS file along the HTML file like so:What does the proposed API look like?
I cant say anything of enabling this by default, but there should be a way to actually inline all the scripts into HTML (this feature is actually useful). For example add a new flag/option config into
inlineScripts
object config.Tasks
The text was updated successfully, but these errors were encountered: