Skip to content

Commit 6d2b427

Browse files
committed
fix(plugin-legacy): fix legacy plugin not working in worker context
1 parent f7b1964 commit 6d2b427

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: packages/plugin-legacy/src/index.ts

+7
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,13 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] {
270270
),
271271
)
272272
}
273+
if (config.isWorker) {
274+
config.logger.warn(
275+
colors.yellow(
276+
`plugin-legacy should not be passed to 'worker.plugins'. Pass to 'plugins' instead. Note that generating legacy chunks for workers are not supported by plugin-legacy.`,
277+
),
278+
)
279+
}
273280
},
274281
}
275282

0 commit comments

Comments
 (0)