We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f17e19a commit a0f00eeCopy full SHA for a0f00ee
packages/vite/src/node/plugins/worker.ts
@@ -41,10 +41,7 @@ export function webWorkerPlugin(config: ResolvedConfig): Plugin {
41
}
42
43
let url: string
44
- if (config.command === 'serve') {
45
- url = await fileToUrl(cleanUrl(id), config, this)
46
- url = injectQuery(url, WorkerFileId)
47
- } else {
+ if (isBuild) {
48
if (query.inline != null) {
49
// bundle the file as entry to support imports and inline as base64
50
// data url
@@ -71,6 +68,9 @@ export function webWorkerPlugin(config: ResolvedConfig): Plugin {
71
68
id: cleanUrl(id)
72
69
})}__`
73
70
+ } else {
+ url = await fileToUrl(cleanUrl(id), config, this)
+ url = injectQuery(url, WorkerFileId)
74
75
76
return `export default function WorkerWrapper() {
0 commit comments