Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(worker): return null for shouldTransformCachedModule #12797

Merged
merged 1 commit into from Apr 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/vite/src/node/plugins/reporter.ts
Expand Up @@ -91,6 +91,10 @@ export function buildReporterPlugin(config: ResolvedConfig): Plugin {
startTime = Date.now()
},

buildStart() {
transformedCount = 0
},
Comment on lines +94 to +96
Copy link
Member Author

Choose a reason for hiding this comment

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

Added one unrelated change here while I'm at it 😬 This makes it so that modules transformed after --watch is reset so we get the real count.


buildEnd() {
if (shouldLogInfo) {
if (tty) {
Expand Down
3 changes: 2 additions & 1 deletion packages/vite/src/node/plugins/worker.ts
Expand Up @@ -240,11 +240,12 @@ export function webWorkerPlugin(config: ResolvedConfig): Plugin {
}
},

// @ts-expect-error return void to fallback to other plugins, even though
// the types doesn't allow it. https://github.com/rollup/rollup/pull/4932
shouldTransformCachedModule({ id }) {
if (isBuild && isWorkerQueryId(id) && config.build.watch) {
return true
}
return false
},

async transform(raw, id, options) {
Expand Down