Skip to content

Commit 8d956f6

Browse files
author
Yaroslav Dobzhanskij
authored
fix: sometimes THIS_IS_UNDEFINED warnings were still shown (#4844)
1 parent 46ecda4 commit 8d956f6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { cleanUrl, injectQuery } from '../utils'
77
import Rollup from 'rollup'
88
import { ENV_PUBLIC_PATH } from '../constants'
99
import path from 'path'
10+
import { onRollupWarning } from '../build'
1011

1112
function parseWorkerRequest(id: string): Record<string, string> | null {
1213
const { search } = parseUrl(id)
@@ -56,7 +57,10 @@ export function webWorkerPlugin(config: ResolvedConfig): Plugin {
5657
const rollup = require('rollup') as typeof Rollup
5758
const bundle = await rollup.rollup({
5859
input: cleanUrl(id),
59-
plugins: await resolvePlugins({ ...config }, [], [], [])
60+
plugins: await resolvePlugins({ ...config }, [], [], []),
61+
onwarn(warning, warn) {
62+
onRollupWarning(warning, warn, config)
63+
},
6064
})
6165
let code: string
6266
try {

0 commit comments

Comments
 (0)