{"id":13605730,"url":"https://github.com/dreambo8563/vite-plugin-bundle-prefetch","last_synced_at":"2025-04-12T12:52:17.516Z","repository":{"id":217436921,"uuid":"743852307","full_name":"dreambo8563/vite-plugin-bundle-prefetch","owner":"dreambo8563","description":"A vite plugin for prefetching resources","archived":false,"fork":false,"pushed_at":"2024-01-16T07:41:23.000Z","size":44,"stargazers_count":19,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T07:36:34.430Z","etag":null,"topics":["prefetch","vite","vite-plugin"],"latest_commit_sha":null,"homepage":"","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/dreambo8563.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}},"created_at":"2024-01-16T06:00:03.000Z","updated_at":"2025-03-19T02:58:22.000Z","dependencies_parsed_at":"2024-01-16T12:35:32.175Z","dependency_job_id":"aec7b9f5-8cfc-48ca-9907-39810494a8b8","html_url":"https://github.com/dreambo8563/vite-plugin-bundle-prefetch","commit_stats":null,"previous_names":["dreambo8563/vite-plugin-bundle-prefetch"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreambo8563%2Fvite-plugin-bundle-prefetch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreambo8563%2Fvite-plugin-bundle-prefetch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreambo8563%2Fvite-plugin-bundle-prefetch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreambo8563%2Fvite-plugin-bundle-prefetch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dreambo8563","download_url":"https://codeload.github.com/dreambo8563/vite-plugin-bundle-prefetch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248571584,"owners_count":21126519,"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":["prefetch","vite","vite-plugin"],"created_at":"2024-08-01T19:01:02.114Z","updated_at":"2025-04-12T12:52:17.495Z","avatar_url":"https://github.com/dreambo8563.png","language":"TypeScript","funding_links":[],"categories":["vite","Plugins"],"sub_categories":["Framework-agnostic Plugins"],"readme":"# Vite-plugin-bundle-prefetch\n\n## Why\n\nthere is no official rollup/vite plugin to work as the webpack prefetch plugin, we just have `preload` in vite, but we really need the prefetch for some Scenario.\n\n## How\n\nsome steps taken by `vite-plugin-bundle-prefetch`\n\n- get all bundles which will include the assetsDir\n- filter the target files (rm .map file or ignore the legacy build)\n- get the final output html file content\n- append the `\u003clink rel=\"prefetch\" href=\"xxxx\"\u003e` in `head`\n\n## Usage\n\n- `npm i vite-plugin-bundle-prefetch -D`\n- import in your vite.config.ts\n\n```ts\n// vite.config.js\nimport prefetchPlugin from 'vite-plugin-bundle-prefetch';\n\nexport default {\n  plugins: [prefetchPlugin()],\n};\n```\n\n## Options\n\n### excludeFn\n\n- **Type**:`Function(assetName:string)=\u003eboolean`\n- **Default**: `undefined`\n- **Desc**: provide the customized method to exclude the files which will be added in index.html\n\n```ts\nexport default {\n  plugins: [\n    prefetchPlugin({\n      excludeFn: (assetName) =\u003e {\n        return assetName.includes('ApproveRecords');\n      },\n    }),\n  ],\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdreambo8563%2Fvite-plugin-bundle-prefetch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdreambo8563%2Fvite-plugin-bundle-prefetch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdreambo8563%2Fvite-plugin-bundle-prefetch/lists"}