Commit ef79a49
fix(compiler): silence INVALID_ANNOTATION and SOURCEMAP_BROKEN warnings from workerPlugin (#6718)
* fix(compiler): drop invalid @__PURE__ before import.meta in workerPlugin
The /*@__PURE__*/ annotation is only meaningful in front of call or
new expressions. In getWorkerMain and getInlineWorker it was placed
before an import.meta.ROLLUP_FILE_URL_* property access, which Rollup
cannot interpret and silently strips with an INVALID_ANNOTATION warning
on every build of a project that uses *.worker.ts entries.
Drop the unused annotation on the workerPath assignment. The remaining
PURE markers on the createWorker(...) / createWorkerProxy(...) calls
are unchanged.
* fix(compiler): emit noop sourcemap from workerPlugin transform
The workerPlugin transform hook returned synthetic wrapper code without
a sourcemap, triggering a SOURCEMAP_BROKEN warning from Rollup for every
project that builds a *.worker.ts entry. The Rollup plugin convention
for transforms that produce code with no useful source-position mapping
is to return an empty mappings string; do that for all five transform
return paths (the mocked hydrate/worker-platform branch and the four
real-bundle branches).
---------
Co-authored-by: oliver <oliver@bitcaster.de>1 parent 2d5ab9f commit ef79a49
1 file changed
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| |||
77 | 80 | | |
78 | 81 | | |
79 | 82 | | |
| 83 | + | |
80 | 84 | | |
81 | 85 | | |
82 | 86 | | |
| |||
98 | 102 | | |
99 | 103 | | |
100 | 104 | | |
| 105 | + | |
101 | 106 | | |
102 | 107 | | |
103 | 108 | | |
| |||
110 | 115 | | |
111 | 116 | | |
112 | 117 | | |
| 118 | + | |
113 | 119 | | |
114 | 120 | | |
115 | 121 | | |
116 | 122 | | |
117 | 123 | | |
| 124 | + | |
118 | 125 | | |
119 | 126 | | |
120 | 127 | | |
| |||
405 | 412 | | |
406 | 413 | | |
407 | 414 | | |
408 | | - | |
| 415 | + | |
409 | 416 | | |
410 | 417 | | |
411 | 418 | | |
| |||
415 | 422 | | |
416 | 423 | | |
417 | 424 | | |
418 | | - | |
| 425 | + | |
419 | 426 | | |
420 | 427 | | |
421 | 428 | | |
| |||
0 commit comments