Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: sometimes THIS_IS_UNDEFINED warnings were still shown #4844

Merged
merged 1 commit into from Sep 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/vite/src/node/plugins/worker.ts
Expand Up @@ -7,6 +7,7 @@ import { cleanUrl, injectQuery } from '../utils'
import Rollup from 'rollup'
import { ENV_PUBLIC_PATH } from '../constants'
import path from 'path'
import { onRollupWarning } from '../build'

function parseWorkerRequest(id: string): Record<string, string> | null {
const { search } = parseUrl(id)
Expand Down Expand Up @@ -56,7 +57,10 @@ export function webWorkerPlugin(config: ResolvedConfig): Plugin {
const rollup = require('rollup') as typeof Rollup
const bundle = await rollup.rollup({
input: cleanUrl(id),
plugins: await resolvePlugins({ ...config }, [], [], [])
plugins: await resolvePlugins({ ...config }, [], [], []),
onwarn(warning, warn) {
onRollupWarning(warning, warn, config)
},
})
let code: string
try {
Expand Down