{"id":21500504,"url":"https://github.com/node-libraries/vite-plugin-miniflare","last_synced_at":"2026-02-11T08:02:28.434Z","repository":{"id":259717572,"uuid":"878229760","full_name":"node-libraries/vite-plugin-miniflare","owner":"node-libraries","description":"Plug-in for running Vite development code on Workerd VM","archived":false,"fork":false,"pushed_at":"2024-10-27T07:04:34.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-27T15:11:04.785Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/node-libraries.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-25T02:09:29.000Z","updated_at":"2024-10-27T12:27:38.000Z","dependencies_parsed_at":"2024-10-27T15:11:06.945Z","dependency_job_id":"f9d52816-21a1-4b91-b4f6-8a504e3f9e6b","html_url":"https://github.com/node-libraries/vite-plugin-miniflare","commit_stats":null,"previous_names":["node-libraries/vite-plugin-miniflare"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-libraries%2Fvite-plugin-miniflare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-libraries%2Fvite-plugin-miniflare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-libraries%2Fvite-plugin-miniflare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-libraries%2Fvite-plugin-miniflare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/node-libraries","download_url":"https://codeload.github.com/node-libraries/vite-plugin-miniflare/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226077594,"owners_count":17570163,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-23T17:41:57.814Z","updated_at":"2026-02-11T08:02:23.377Z","avatar_url":"https://github.com/node-libraries.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vite-plugin-miniflare\n\nvite@6 or higher is required.\n\n## Sample code\n\nhttps://github.com/SoraKumo001/hono-miniflare  \nhttps://github.com/SoraKumo001/remix-prisma-vite-miniflare\n\n- vite.config.ts\n\nUsing vite-plugin-miniflare\n\n```ts\nimport { defineConfig } from \"vite\";\nimport { devServer } from \"vite-plugin-miniflare\";\nexport default defineConfig({\n  // Only if the front module is required\n  // build: {},\n\n  plugins: [\n    devServer({\n      entry: \"src/index.tsx\",\n      // Bundle all ENTRY modules.\n      bundle: true,\n      // Set to true for automatic reloading without HMR\n      reload: true,\n    }),\n  ],\n});\n```\n\n- src/index.tsx\n\nMaking CacheAPI work on Vite\n\n```ts\nimport { Hono } from \"hono\";\n\nconst app = new Hono();\n\nconst getCount = async () =\u003e {\n  const cache = await caches.open(\"hono-ssr-react-miniflare\");\n  const url = new URL(\"/count\", \"http://localhost\");\n  const cachedResponse = await cache.match(url);\n  const count = cachedResponse ? parseInt(await cachedResponse.text()) : 1;\n  await cache.put(\n    url,\n    new Response((count + 1).toString(), {\n      headers: {\n        \"Content-Type\": \"text/plain\",\n        \"Cache-Control\": \"max-age=31536000\",\n      },\n    })\n  );\n  return count;\n};\n\napp.get(\"*\", async (c) =\u003e {\n  return c.html(\n    \u003chtml\u003e\n      \u003cbody\u003e{await getCount()}\u003c/body\u003e\n    \u003c/html\u003e\n  );\n});\n\nexport default app;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-libraries%2Fvite-plugin-miniflare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnode-libraries%2Fvite-plugin-miniflare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-libraries%2Fvite-plugin-miniflare/lists"}