Skip to content

Possiblity to use this with [email protected] worker loading? #1031

Open
@Nantris

Description

@Nantris

I'm wondering if there's any way to use this package without needing to assign our worker file to a <div /> to be "upgraded."

The problem is that our worker thread is being bundled via Webpack at the same time as the rest of our application and the output page is created using an HTML template. I'm not sure how it would be possible to assign the worker scripts to a div in this setup. Is there any way we can use the library in conjunction with the way Webpack bundles workers?

For reference, our code for creating our worker threads right now looks like this:

new Worker(new URL('./heavyLifterWorker', import.meta.url), {
  name: 'heavyLifter',
}),

and then Webpack is automatically bundling the worker chunk and injecting it into the page without any input from us. Is there any way to leverage Worker-DOM together with the built-in Webpack worker loading functionality?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions