Setting workerChunkLoading and outputModule options for a specific web worker while maintaining Webpack defaults for others #17387
|
I have a web application that employs multiple web workers, and I'm currently facing a configuration challenge regarding one particular web worker. I have explored the documentation and experimented with different configurations, but I haven't been able to achieve the desired outcome. I would greatly appreciate any insights or suggestions on how to accomplish this task effectively. |
Replies: 2 comments 2 replies
|
Do you want to set module.exports = [
{
name: "my-worker"
entry: "./my-specific.worker.js",
target: ["webworker", "es2020"],
experiments: { outputModules: true },
output: { modules: true, filename: "[name].js" }
},
{
target: "web",
dependecies: ["my-worker"]
// Other options
}
];So you will bundle specific loaders firstly, then bundle your application |
|
Thank you so much @alexander-akait |
@rishabhjain9191 Try this: