Open
Description
What problem does this feature solve?
the bundleless workaround
defineConfig({
lib: [{
bundle: false,
format: 'esm',
syntax: 'esnext',
tools: {
rspack: {
module: {
parser: {
javascript: {
worker: false,
},
},
},
},
},
}]
})
but in bundle mode
there are tons of webpack runtime

What does the proposed API look like?
test demo: https://github.com/SoonIter/rslib-worker-demo
in bundle the output should be:
index.js
fib-worker.js
chat-worker.js
// ...
const chatWorker = new SharedWorker(new URL('./chat-worker.js', import.meta.url), {
name: 'chat',
type: 'module'
});
// ...
const fibWorker = new Worker(new URL('./fib-worker.js', import.meta.url), {
name: 'fibonacci',
type: 'module'
});
Metadata
Metadata
Assignees
Labels
No labels