Skip to content

Commit

Permalink
fix(worker): return null for shouldTransformCachedModule (#12797)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Apr 9, 2023
1 parent 46bdf7d commit ea5f6fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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
},

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

0 comments on commit ea5f6fc

Please sign in to comment.