Skip to content

Commit 9875146

Browse files
bartlomiejuclaude
andauthored
fix: improve Deno module resolution in Vite plugin (#3734)
## Summary Three targeted fixes to Fresh's Vite plugin for better module resolution, plus new test coverage. ### 1. Workspace import map resolution Pass the importer's file URL to `loader.resolve()` so bare specifiers from workspace member packages resolve through the correct import map — not just the root `deno.json`. Fixes #3654 ### 2. Remote island resolution Use `this.resolve(spec)` in the `fresh-island::` and `fresh-client-island::` resolveId handlers (`server_snapshot.ts` / `client_snapshot.ts`) so JSR remote islands get proper `\0deno::` specifiers. Without this, remote islands resolved to bare specifiers that Vite couldn't load. Fixes #3437 ### 3. Babel JSX operator precedence fix `!ssr && id.endsWith(".tsx") || id.endsWith(".jsx")` → `!ssr && (id.endsWith(".tsx") || id.endsWith(".jsx"))`. The missing parentheses caused `.jsx` files to incorrectly get Preact JSX transforms during SSR. ### Other changes - Bump `@deno/loader` from ^0.3.10 to ^0.4.0 (needed for workspace resolution fix) - Bump `@astral/astral` from ^0.5.5 to ^0.5.6 (fixes `@std/async@1.2.0` compat) - Add dev server tests for CJS module import and maxmind CJS (#3653) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3a51f82 commit 9875146

8 files changed

Lines changed: 287 additions & 367 deletions

File tree

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"@std/semver": "jsr:@std/semver@1",
7575
"@std/streams": "jsr:@std/streams@1",
7676

77-
"@astral/astral": "jsr:@astral/astral@^0.5.5",
77+
"@astral/astral": "jsr:@astral/astral@^0.5.6",
7878
"@marvinh-test/fresh-island": "jsr:@marvinh-test/fresh-island@^0.0.3",
7979
"linkedom": "npm:linkedom@^0.18.10",
8080
"@std/async": "jsr:@std/async@^1.0.13",

0 commit comments

Comments
 (0)