Skip to content

perf(worker): rebuild only when affected - #20559

Merged
sapphi-red merged 3 commits into
vitejs:mainfrom
sapphi-red:perf/worker-build-only-when-affected
Oct 22, 2025
Merged

sapphi-red merged 3 commits into
vitejs:mainfrom
sapphi-red:perf/worker-build-only-when-affected

Conversation

@sapphi-red

Copy link
Copy Markdown
Member

Description

Instead of building the worker every time any file is changed (before this PR shouldTransformCachedModule returns true), this PR makes the worker plugin to track the watched files so that the worker is re-built only when the content is changed.

This PR was initiated by the fact that the usage of shouldTransformCachedModule makes it difficult to make the plugins performant (rolldown/rolldown#4389).

refs #11919, #14712

@sapphi-red sapphi-red added p2-nice-to-have Not breaking anything but nice to have (priority) feat: web workers labels Aug 7, 2025
@sapphi-red

Copy link
Copy Markdown
Member Author

/ecosystem-ci run

@pkg-pr-new

pkg-pr-new Bot commented Aug 27, 2025 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/vite@20559

commit: f4de220

@vite-ecosystem-ci

Copy link
Copy Markdown

@sapphi-red sapphi-red added this to the 7.2 milestone Sep 1, 2025

@bluwy bluwy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 👍

@sapphi-red
sapphi-red merged commit 5cd3890 into vitejs:main Oct 22, 2025
@sapphi-red
sapphi-red deleted the perf/worker-build-only-when-affected branch October 24, 2025 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat: web workers p2-nice-to-have Not breaking anything but nice to have (priority) trigger: preview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants