{"id":27765743,"url":"https://github.com/yusukebe/vite-plugin-ssr-hot-reload","last_synced_at":"2026-03-04T18:31:45.300Z","repository":{"id":284302738,"uuid":"954518471","full_name":"yusukebe/vite-plugin-ssr-hot-reload","owner":"yusukebe","description":"Vite plugin for hot-reloading SSR pages","archived":false,"fork":false,"pushed_at":"2025-04-19T12:19:33.000Z","size":92,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-21T17:42:46.527Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/vite-plugin-ssr-hot-reload","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/yusukebe.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,"zenodo":null}},"created_at":"2025-03-25T07:54:16.000Z","updated_at":"2025-05-16T16:23:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"936cc455-f7a8-41da-80c1-ec06e258638b","html_url":"https://github.com/yusukebe/vite-plugin-ssr-hot-reload","commit_stats":null,"previous_names":["yusukebe/vite-plugin-ssr-hot-reload"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/yusukebe/vite-plugin-ssr-hot-reload","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusukebe%2Fvite-plugin-ssr-hot-reload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusukebe%2Fvite-plugin-ssr-hot-reload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusukebe%2Fvite-plugin-ssr-hot-reload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusukebe%2Fvite-plugin-ssr-hot-reload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yusukebe","download_url":"https://codeload.github.com/yusukebe/vite-plugin-ssr-hot-reload/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusukebe%2Fvite-plugin-ssr-hot-reload/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30089332,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T18:31:08.343Z","status":"ssl_error","status_checked_at":"2026-03-04T18:31:07.708Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2025-04-29T17:00:09.100Z","updated_at":"2026-03-04T18:31:45.278Z","avatar_url":"https://github.com/yusukebe.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vite-plugin-ssr-hot-reload\n\nA Vite plugin that forces a full page reload when your SSR entry file changes. It also injects `@vite/client` into the HTML response so hot reload can work properly.\n\n## Install\n\n```bash\nnpm install -D vite-plugin-ssr-hot-reload\n```\n\n## Usage\n\n```ts\n// vite.config.ts\nimport { defineConfig } from 'vite'\nimport ssrHotReload from 'vite-plugin-ssr-hot-reload'\n\nexport default defineConfig({\n  plugins: [ssrHotReload()]\n})\n```\n\n## Options\n\n### entry\n\nYou can pass `entry` to specify which files should trigger a full reload.\n\n```ts\nssrHotReload({\n  entry: ['/src/pages/**/*.tsx', '/src/layouts/**/*.ts']\n})\n```\n\nBy default, the plugin watches:\n\n```ts\nentry: ['/src/**/*.ts', '/src/**/*.tsx']\n```\n\n### ignore\n\nYou can pass `ignore` to specify which files should be excluded from triggering a full reload, even if they match the entry patterns.\n\n```ts\nssrHotReload({\n  entry: ['/src/pages/**/*.tsx'],\n  ignore: ['/src/pages/ignored/**/*.tsx']\n})\n```\n\n### injectReactRefresh\n\nYou can pass `injectReactRefresh: true` to inject React Refresh scripts into the HTML head. This is useful for React applications that need hot module replacement for React components.\n\n**Note:** To use this feature, you need to install `@vitejs/plugin-react` in your project.\n\n```ts\n// First, install @vitejs/plugin-react\n// npm install -D @vitejs/plugin-react\n\n// Then in your vite.config.ts\nimport { defineConfig } from 'vite'\nimport react from '@vitejs/plugin-react'\nimport ssrHotReload from 'vite-plugin-ssr-hot-reload'\n\nexport default defineConfig({\n  plugins: [\n    react(), // Make sure to include the React plugin\n    ssrHotReload({\n      injectReactRefresh: true\n    })\n  ]\n})\n```\n\nWhen enabled, the plugin injects the following scripts at the end of the `\u003chead\u003e` tag:\n\n```html\n\u003cscript type=\"module\" src=\"/@react-refresh\"\u003e\u003c/script\u003e\n\u003cscript type=\"module\"\u003e\n  import RefreshRuntime from '/@react-refresh'\n  RefreshRuntime.injectIntoGlobalHook(window)\n  window.$RefreshReg$ = () =\u003e {}\n  window.$RefreshSig$ = () =\u003e (type) =\u003e type\n  window.__vite_plugin_react_preamble_installed__ = true\n\u003c/script\u003e\n```\n\n## What it does\n\n- Injects `\u003cscript type=\"module\" src=\"/@vite/client\"\u003e` into HTML responses (only in dev)\n- Optionally injects React Refresh scripts into the HTML head when `injectReactRefresh: true` is set\n- Sends a full-reload signal when an SSR module is updated\n\n## Author\n\nYusuke Wada \u003chttps://github.com/yusukebe\u003e\n\n## License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyusukebe%2Fvite-plugin-ssr-hot-reload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyusukebe%2Fvite-plugin-ssr-hot-reload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyusukebe%2Fvite-plugin-ssr-hot-reload/lists"}