Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: include imported worker assets in build manifest (fix #23377) - #23384

Open
DaZuiZui wants to merge 3 commits into
vitejs:mainfrom
DaZuiZui:codex/fix-worker-manifest
Open

fix: include imported worker assets in build manifest (fix #23377)#23384
DaZuiZui wants to merge 3 commits into
vitejs:mainfrom
DaZuiZui:codex/fix-worker-manifest

Conversation

@DaZuiZui

@DaZuiZui DaZuiZui commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

This fixes missing worker assets in the Vite build manifest when a worker is imported with ?worker&url (and related bundled worker references).

Why?

Vite emits the worker file to dist/assets, but the emitted asset loses its originalFileName metadata. Rolldown's manifest plugin uses that metadata to associate assets with their importing entry, so the worker is omitted from manifest.json. This prevents integrations such as SvelteKit from discovering the worker for service-worker caching.

The fix preserves the worker bundle/chunk source metadata and passes originalFileName when the asset is emitted. The worker is then listed in the importing entry's assets array.

Fixes #23377

Alternatives considered

A framework-specific workaround would duplicate Vite's asset tracking. Since the file is already emitted by Vite, keeping its source metadata is the minimal fix at the correct layer.

Tests

  • Added a regression assertion in the worker playground manifest tests.
  • pnpm --filter vite typecheck
  • pnpm --filter vite build
  • Built the reported reproduction and confirmed the worker is present in manifest.json.

Browser E2E was not run because Playwright Chromium is not installed in the local environment.

AI disclosure

AI assistance was used during the investigation and drafting of this PR. I reviewed the generated changes, verified the root cause against the Rolldown/Vite build flow, and ran the checks listed above.

@DaZuiZui DaZuiZui changed the title fix: include imported worker assets in build manifest fix: include imported worker assets in build manifest (fix #23377) Aug 27, 2026
@DaZuiZui
DaZuiZui force-pushed the codex/fix-worker-manifest branch from 797ec31 to e54ec62 Compare August 27, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Imported worker missing from Vite build manifest

1 participant