[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-81586":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":12,"openIssues":13,"contributorsCount":13,"subscribersCount":13,"size":13,"stars1d":13,"stars7d":13,"stars30d":13,"stars90d":13,"forks30d":13,"starsTrendScore":13,"compositeScore":14,"rankGlobal":10,"rankLanguage":10,"license":15,"archived":16,"fork":16,"defaultBranch":17,"hasWiki":16,"hasPages":16,"topics":18,"createdAt":10,"pushedAt":10,"updatedAt":19,"readmeContent":20,"aiSummary":21,"trendingCount":13,"starSnapshotCount":13,"syncStatus":22,"lastSyncTime":23,"discoverSource":24},81586,"vite-plugin-remix3","pi0\u002Fvite-plugin-remix3","pi0","🏎️ Vite plugin that unblocks Remix v3 apps to be developed, optimized and deployed everywhere with Nitro.","https:\u002F\u002Fnitro-remix3.vercel.app",null,"TypeScript",23,0,40,"MIT License",false,"main",[],"2026-06-12 04:01:34","# vite-plugin-remix3\n\nVite plugin that lets [Remix v3](https:\u002F\u002Fremix.run\u002F) apps be developed, optimized, and deployed everywhere with [Nitro](https:\u002F\u002Fnitro.build).\n\n## Why?\n\nRemix v3 is cool, but it's runtime-only — every dependency ships to production unoptimized. Bundles balloon, cold starts drag, and cross-platform deployment becomes nearly impossible.\n\n`remix@3.0.0-beta.0` pulls in **112 dependencies from 63 maintainers** ([npm graph](https:\u002F\u002Fnpmgraph.js.org\u002F?q=remix@3.0.0-beta.0#select=remix%403.0.0-beta.0)) and requires an on-demand build on server startup using tsx.\n\nPairing Remix with Vite and Nitro unlocks the build-time optimizations and deployment targets that were previously out of reach.\n\n| metric           | buildless (tsx) | build (vite + nitro) | smaller |\n| ---------------- | --------------: | -------------------: | ------: |\n| ship size        |       163.33 MB |            295.90 KB |    565× |\n| ship size (gzip) |        58.29 MB |             92.04 KB |    649× |\n| files            |           2,891 |                   25 |    116× |\n| build time       |               — |               376 ms |       — |\n| startup time     |          389 ms |                59 ms |    6.6× |\n| RSS at ready     |       155.01 MB |             96.25 MB |    1.6× |\n\nBenchmarks: [source](.\u002Fbenchmark) ran on Linux with Node.js v24.15.0 and are only an indicator.\n\n## How it works\n\nTwo plugins, one job each:\n\n- **`vite-plugin-remix3`** tells Vite about your app's two entry graphs — `client` (your `app\u002Fentry.client.*` files, bundled and hashed) and `ssr` (your server entry).\n- **`nitro\u002Fvite`** manages the server. In dev it serves requests through the SSR entry; in prod it produces a `.output\u002F` bundle that deploys to Node or anywhere else.\n\n**`?assets=client` imports** are how SSR finds the right URLs for your client bundle. In components that render `\u003Cscript>` \u002F `\u003Clink>` tags:\n\n```ts\nimport entryAssets from \"..\u002Fentry.client.ts?assets=client\";\n\u002F\u002F entryAssets.entry → \"\u002Fapp\u002Fentry.client.ts\" in dev\n\u002F\u002F entryAssets.entry → \"\u002Fassets\u002Fapp\u002Fentry.client-\u003Chash>.js\" in prod\n```\n\nIn dev these resolve to source URLs that Vite transforms on the fly. In prod they resolve to hashed chunks served as static files from `.output\u002Fpublic\u002F`. This replaces Remix's runtime `createAssetServer` with build-time URLs. Thanks to [vite-plugin-fullstack](https:\u002F\u002Fgithub.com\u002Fhi-ogawa\u002Fvite-plugin-fullstack) that is enabled out of the box in Nitro!\n\n## Getting started\n\nQuickly start with the [starter template](.\u002Fstarter\u002F):\n\n```sh\nnpx -y giget gh:pi0\u002Fvite-plugin-remix3\u002Fstarter remix3-app\n```\n\n## Deployment\n\nNitro deployment is zero config and without any additional dependencies!\n\nBy default a portable Node.js server will be generated in `.output\u002F` dir and you can just run or deploy your app anywhere you want ([read the docs](https:\u002F\u002Fnitro.build\u002Fdeploy))\n\nExample deployments of starter template:\n\n- [on Vercel](https:\u002F\u002Fnitro-remix3.vercel.app\u002F)\n- [on Cloudflare](https:\u002F\u002Fvite-plugin-remix3.pooya-sandbox.workers.dev\u002F)\n\n## Migration\n\nTo migrate a stock Remix v3 starter onto Vite + Nitro:\n\n**1. Install and add `vite.config.ts`:**\n\n```sh\npnpm add -D vite nitro vite-plugin-remix3\n```\n\n```ts\n\u002F\u002F vite.config.ts\nimport { defineConfig } from \"vite\";\nimport { nitro } from \"nitro\u002Fvite\";\nimport { remix } from \"vite-plugin-remix3\";\n\nexport default defineConfig({ plugins: [nitro(), remix()] });\n```\n\nUpdate `package.json` scripts to `vite dev` \u002F `vite build` \u002F `vite preview`, and drop `tsx`.\n\n**2. Delete `server.ts` and `app\u002Fassets.ts`.** Nitro provides the server; Vite replaces the runtime asset server. Also remove the `routes.assets` handler from [app\u002Frouter.ts](.\u002Fstarter\u002Fapp\u002Frouter.ts) (the route entry itself can stay).\n\n**3. Create [app\u002Fentry.server.ts](.\u002Fstarter\u002Fapp\u002Fentry.server.ts)** — the default `ssrEntry`. Nitro reads the SSR handler from its default export:\n\n```ts\nimport { router } from \".\u002Frouter.ts\";\n\nexport default { fetch: router.fetch };\n```\n\n**4. Move `app\u002Fassets\u002Fentry.ts` → [app\u002Fentry.client.ts](.\u002Fstarter\u002Fapp\u002Fentry.client.ts)** and switch dynamic `import()` to `import.meta.glob` (Vite needs a static module map):\n\n```ts\nconst modules = import.meta.glob([\n  \"\u002Fapp\u002F**\u002F*.{ts,tsx,js,jsx}\",\n  \"!\u002Fapp\u002F**\u002F*.server.*\",\n  \"!\u002Fapp\u002F**\u002F*.d.ts\",\n]);\n\nrun({\n  async loadModule(moduleUrl, exportName) {\n    const key = moduleUrl.replace(\u002F^\\\u002Fassets\u002F, \"\");\n    const mod = await modules[key]();\n    return mod[exportName];\n  },\n  \u002F\u002F resolveFrame unchanged\n});\n```\n\n**5. Use the `?assets=client` import in components that emit the entry `\u003Cscript>`** (e.g. [document.tsx](.\u002Fstarter\u002Fapp\u002Fui\u002Fdocument.tsx)), so prod gets the hashed URL:\n\n```tsx\nimport entryAssets from \"..\u002Fentry.client.ts?assets=client\";\n\n{\n  entryAssets.css.map((f) => \u003Clink rel=\"stylesheet\" href={f.href} \u002F>);\n}\n\u003Cscript type=\"module\" src={entryAssets.entry} \u002F>;\n```\n\n**6. Add `.output` to `.gitignore`.**\n\n> [!IMPORTANT]\n> Don't reintroduce a top-level `server.ts` importing [app\u002Frouter.ts](.\u002Fstarter\u002Fapp\u002Frouter.ts) — it pulls the rendering chain into Nitro's build graph and the asset manifest comes out empty. See [AGENTS.md](.\u002FAGENTS.md).\n\n## License\n\nPublished under the [MIT](.\u002FLICENSE) license 💛.\n","vite-plugin-remix3 是一个 Vite 插件，它使 Remix v3 应用能够通过 Nitro 进行开发、优化和部署。该项目利用 Vite 的构建时优化能力与 Nitro 的跨平台部署支持，显著减少了应用的打包体积（从 163.33 MB 减少到 295.90 KB），缩短了启动时间（从 389 ms 减少到 59 ms），并提高了冷启动性能，从而解决了 Remix v3 在生产环境中依赖未优化导致的问题。此插件特别适用于需要高性能且易于部署的现代 Web 应用场景。使用 TypeScript 编写，遵循 MIT 许可证开放源代码。",2,"2026-06-11 04:05:37","CREATED_QUERY"]