Skip to content

Commit 828a8e5

Browse files
authored
chore: remove usage of querystring (#4342)
1 parent 0693d03 commit 828a8e5

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
import { ResolvedConfig } from '../config'
22
import { Plugin } from '../plugin'
33
import { resolvePlugins } from '../plugins'
4-
import { parse as parseUrl } from 'url'
5-
import qs, { ParsedUrlQuery } from 'querystring'
4+
import { parse as parseUrl, URLSearchParams } from 'url'
65
import { fileToUrl, getAssetHash } from './asset'
76
import { cleanUrl, injectQuery } from '../utils'
87
import Rollup from 'rollup'
98
import { ENV_PUBLIC_PATH } from '../constants'
109
import path from 'path'
1110

12-
function parseWorkerRequest(id: string): ParsedUrlQuery | null {
11+
function parseWorkerRequest(id: string): Record<string, string> | null {
1312
const { search } = parseUrl(id)
1413
if (!search) {
1514
return null
1615
}
17-
return qs.parse(search.slice(1))
16+
return Object.fromEntries(new URLSearchParams(search.slice(1)))
1817
}
1918

2019
const WorkerFileId = 'worker_file'

0 commit comments

Comments
 (0)