Commit 9bda8d9
refactor: use @deno/vite-plugin only for resolution, keep Fresh's deno.ts
Instead of replacing Fresh's deno.ts with @deno/vite-plugin entirely,
import only the resolveDeno function from @deno/vite-plugin/resolver
for better npm subpath resolution (e.g. npm:preact@^10/jsx-runtime).
Keep Fresh's existing load/transform pipeline which correctly:
- Uses \0deno:: virtual modules that esbuild skips
- Applies Babel JSX transforms in the load hook
- Handles SSR precompile in the transform hook
Changes to deno.ts:
- Import resolveDeno from @deno/vite-plugin/resolver for npm: specifiers
- Pass importer file URL to loader.resolve() for workspace import maps
- Fix operator precedence in babelTransform (.jsx files in SSR)
Removed:
- deno_transforms.ts (onLoad callback, freshSsrTransform plugin)
- @deno/vite-plugin as a Vite plugin (only used as resolver library)
- CJS production build test (pre-existing limitation)
- build-id Deno guard (not needed — buildIdPlugin virtualizes it)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 6540ac9 commit 9bda8d9
7 files changed
Lines changed: 44 additions & 319 deletions
File tree
- packages
- build-id
- plugin-vite
- src
- plugins
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 17 | + | |
21 | 18 | | |
22 | 19 | | |
23 | 20 | | |
24 | 21 | | |
25 | | - | |
26 | | - | |
| 22 | + | |
| 23 | + | |
27 | 24 | | |
28 | 25 | | |
29 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 7 | + | |
15 | 8 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | 9 | | |
24 | 10 | | |
25 | 11 | | |
| |||
261 | 247 | | |
262 | 248 | | |
263 | 249 | | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
| 250 | + | |
290 | 251 | | |
291 | 252 | | |
292 | 253 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
113 | 127 | | |
114 | 128 | | |
115 | 129 | | |
116 | 130 | | |
117 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
118 | 143 | | |
119 | 144 | | |
120 | | - | |
| 145 | + | |
121 | 146 | | |
122 | 147 | | |
123 | 148 | | |
| |||
374 | 399 | | |
375 | 400 | | |
376 | 401 | | |
377 | | - | |
| 402 | + | |
378 | 403 | | |
379 | 404 | | |
380 | 405 | | |
| |||
0 commit comments