Skip to content

Conversation

@sapphi-red
Copy link
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
Member Author

/ecosystem-ci run

@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 27, 2025

Open in StackBlitz

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

commit: f4de220

@vite-ecosystem-ci
Copy link

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

@bluwy bluwy left a comment

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
17 checks passed
@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