Skip to content

Commit 958cdf2

Browse files
authored
refactor: use hook filters in the worker plugin (vitejs#20527)
1 parent 8be2787 commit 958cdf2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/vite/src/node/plugins/worker.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ export function webWorkerPlugin(config: ResolvedConfig): Plugin {
262262
},
263263

264264
load: {
265+
filter: { id: workerOrSharedWorkerRE },
265266
async handler(id) {
266267
const workerMatch = workerOrSharedWorkerRE.exec(id)
267268
if (!workerMatch) return
@@ -364,6 +365,7 @@ export function webWorkerPlugin(config: ResolvedConfig): Plugin {
364365
},
365366

366367
transform: {
368+
filter: { id: workerFileRE },
367369
async handler(raw, id) {
368370
const workerFileMatch = workerFileRE.exec(id)
369371
if (workerFileMatch) {

0 commit comments

Comments
 (0)