Skip to content

Generate modulepreload for module workers #22712

Description

@sapphi-red

Description

Async Chunk Loading Optimization is not applied to worker chunks.

In this example project, the worker chunk statically imports a different chunk.
https://stackblitz.com/edit/vitejs-vite-a6hmzk2g?file=src%2Fmain.ts
But the modulepreload links are not inserted when creating the worker, causing the statically imported chunk not to be preloaded together.

It might be difficult if the new Worker exists in the worker chunk.

Suggested solution

Add Async Chunk Loading Optimization for module workers.

Alternative

No response

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions