Files
sweet/packages/plugin-vite/deno.json
T
Bartek IwańczukandClaude Opus 4.6 9875146cc4 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>
2026-04-03 15:40:46 +02:00

49 lines
1.6 KiB
JSON

{
"name": "@fresh/plugin-vite",
"version": "1.0.8",
"license": "MIT",
"exports": {
".": "./src/mod.ts",
"./client": "./src/client.ts"
},
"publish": {
"include": ["./src", "README.md"]
},
"compilerOptions": {
"jsx": "precompile",
"jsxImportSource": "preact",
"types": ["vite/client"]
},
"tasks": {
"demo": "vite demo",
"debug": "deno run -A --inspect-brk npm:vite demo",
"demo:build": "vite build demo",
"demo:start": "cd demo && deno serve -A _fresh/server.js"
},
"imports": {
"@babel/core": "npm:@babel/core@^7.28.0",
"@babel/preset-react": "npm:@babel/preset-react@^7.27.1",
"@deno/loader": "jsr:@deno/loader@^0.4.0",
"@marvinh-test/import-json": "jsr:@marvinh-test/import-json@^0.0.1",
"@remix-run/node-fetch-server": "npm:@remix-run/node-fetch-server@^0.12.0",
"@prefresh/vite": "npm:@prefresh/vite@^2.4.8",
"@radix-ui/themes": "npm:@radix-ui/themes@^3.2.1",
"@tailwindcss/vite": "npm:@tailwindcss/vite@^4.1.12",
"@types/babel__core": "npm:@types/babel__core@^7.20.5",
"@types/node": "npm:@types/node@^24.1.0",
"@types/qs": "npm:@types/qs@^6.14.0",
"feed": "npm:feed@^5.1.0",
"fresh": "jsr:@fresh/core@^2.0.0",
"ioredis": "npm:ioredis@^5.7.0",
"mime-db": "npm:mime-db@^1.54.0",
"pg": "npm:pg@^8.16.3",
"preact": "npm:preact@^10.26.9",
"qs": "npm:qs@^6.14.0",
"rollup-plugin-visualizer": "npm:rollup-plugin-visualizer@^6.0.3",
"stripe": "npm:stripe@^19.1.0",
"vite": "npm:vite@^7.1.4",
"vite-plugin-inspect": "npm:vite-plugin-inspect@^11.3.2",
"vite-plugin-pwa": "npm:vite-plugin-pwa@^1.0.3"
}
}