Skip to content

Commit 420eb32

Browse files
authored
feat(native-plugin): use js web worker post in dev environment (#244)
1 parent 94c97b7 commit 420eb32

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,10 @@ export async function workerFileToUrl(
242242
}
243243

244244
export function webWorkerPostPlugin(config: ResolvedConfig): Plugin {
245-
if (config.experimental.enableNativePlugin === true) {
245+
if (
246+
config.experimental.enableNativePlugin === true &&
247+
config.command === 'build'
248+
) {
246249
return perEnvironmentPlugin(
247250
'native:web-worker-post-plugin',
248251
(environment) => {

0 commit comments

Comments
 (0)