{"id":13417409,"url":"https://github.com/ElMassimo/vite-plugin-full-reload","last_synced_at":"2025-03-15T02:31:18.143Z","repository":{"id":37631316,"uuid":"348523910","full_name":"ElMassimo/vite-plugin-full-reload","owner":"ElMassimo","description":"♻️ Automatically reload the page when files are modified","archived":false,"fork":false,"pushed_at":"2024-07-08T23:16:03.000Z","size":265,"stargazers_count":159,"open_issues_count":6,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-09T05:26:52.967Z","etag":null,"topics":["file-watcher","full-reload","livereload","vite-plugin","vitejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ElMassimo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2021-03-16T23:44:38.000Z","updated_at":"2025-02-24T17:21:24.000Z","dependencies_parsed_at":"2024-01-07T18:05:54.586Z","dependency_job_id":"8bbea76e-dddd-4455-afc2-4edcd8b447aa","html_url":"https://github.com/ElMassimo/vite-plugin-full-reload","commit_stats":{"total_commits":40,"total_committers":3,"mean_commits":"13.333333333333334","dds":0.09999999999999998,"last_synced_commit":"ef7926174c2584f95f679af18b32a38d78ddec4a"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElMassimo%2Fvite-plugin-full-reload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElMassimo%2Fvite-plugin-full-reload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElMassimo%2Fvite-plugin-full-reload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElMassimo%2Fvite-plugin-full-reload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ElMassimo","download_url":"https://codeload.github.com/ElMassimo/vite-plugin-full-reload/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243213981,"owners_count":20254902,"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":["file-watcher","full-reload","livereload","vite-plugin","vitejs"],"created_at":"2024-07-30T22:00:36.658Z","updated_at":"2025-03-15T02:31:17.778Z","avatar_url":"https://github.com/ElMassimo.png","language":"JavaScript","funding_links":[],"categories":["Plugins","JavaScript","TypeScript"],"sub_categories":["Framework-agnostic Plugins"],"readme":"\u003ch2 align='center'\u003e\u003csamp\u003evite-plugin-full-reload\u003c/samp\u003e\u003c/h2\u003e\n\n\u003cp align='center'\u003eAutomatically reload the page when files are modified\u003c/p\u003e\n\n\u003cp align='center'\u003e\n  \u003ca href='https://www.npmjs.com/package/vite-plugin-full-reload'\u003e\n    \u003cimg src='https://img.shields.io/npm/v/vite-plugin-full-reload?color=222\u0026style=flat-square'\u003e\n  \u003c/a\u003e\n  \u003ca href='https://github.com/ElMassimo/vite-plugin-full-reload/blob/main/LICENSE.txt'\u003e\n    \u003cimg src='https://img.shields.io/badge/license-MIT-blue.svg'\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cbr\u003e\n\n[vite-plugin-full-reload]: https://github.com/ElMassimo/vite-plugin-full-reload\n[vite-plugin-live-reload]: https://github.com/arnoson/vite-plugin-live-reload\n[Vite Ruby]: https://github.com/ElMassimo/vite_ruby\n[JS From Routes]: https://github.com/ElMassimo/js_from_routes\n[picomatch]: https://github.com/micromatch/picomatch#globbing-features\n\n## Why? 🤔\n\nWhen using _[Vite Ruby]_, I wanted to see changes to server-rendered layouts and templates without having to manually reload the page.\n\nAlso, in _[JS From Routes]_ path helpers are generated when Rails reload is triggered.\n\nTriggering a page reload when `config/routes.rb` is modified makes the DX very smooth.\n\n## Installation 💿\n\nInstall the package as a development dependency:\n\n```bash\nnpm i -D vite-plugin-full-reload # yarn add -D vite-plugin-full-reload\n```\n\n## Usage 🚀\n\nAdd it to your plugins in `vite.config.ts`\n\n```ts\nimport { defineConfig } from 'vite'\nimport FullReload from 'vite-plugin-full-reload'\n\nexport default defineConfig({\n  plugins: [\n    FullReload(['config/routes.rb', 'app/views/**/*'])\n  ],\n})\n```\n\nThis is useful to trigger a page refresh for files that are not being imported, such as server-rendered templates.\n\nTo see which file globbing options are available, check [picomatch].\n\n## Configuration ⚙️\n\nThe following options can be provided:\n\n- \u003ckbd\u003eroot\u003c/kbd\u003e\n  \n  Files will be resolved against this directory.\n\n  __Default:__ `process.cwd()`\n\n  ``` js\n  FullReload('config/routes.rb', { root: __dirname }),\n  ``` \n\n- \u003ckbd\u003edelay\u003c/kbd\u003e\n\n  How many milliseconds to wait before reloading the page after a file change.\n  It can be used to offset slow template compilation in Rails.\n\n  __Default:__ `0`\n  \n  ```js\n  FullReload('app/views/**/*', { delay: 100 })\n  ``` \n\n- \u003ckbd\u003ealways\u003c/kbd\u003e\n\n  Whether to refresh the page even if the modified HTML file is not currently being displayed.\n\n  __Default:__ `true`\n  \n  ```js\n  FullReload('app/views/**/*', { always: false })\n  ``` \n\n## Acknowledgements\n\n- \u003ckbd\u003e[vite-plugin-live-reload]\u003c/kbd\u003e\n\n  This is a nice plugin, I found it right before publishing this one.\n\n  I've made [two](https://github.com/arnoson/vite-plugin-live-reload/pull/3) [PRs](https://github.com/arnoson/vite-plugin-live-reload/pull/5) that were needed to support these use cases.\n\n  At this point in time they are very similar, except this library doesn't create another `chokidar` watcher.\n\n## License\n\nThis library is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FElMassimo%2Fvite-plugin-full-reload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FElMassimo%2Fvite-plugin-full-reload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FElMassimo%2Fvite-plugin-full-reload/lists"}