{"id":24630938,"url":"https://github.com/jarweb/resourcehints-webpack-plugin","last_synced_at":"2025-05-08T00:47:19.113Z","repository":{"id":42910201,"uuid":"249639521","full_name":"Jarweb/resourcehints-webpack-plugin","owner":"Jarweb","description":"a webpack@4x plugin for resource hints","archived":false,"fork":false,"pushed_at":"2023-03-04T08:11:59.000Z","size":238,"stargazers_count":4,"open_issues_count":7,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-08T00:47:12.912Z","etag":null,"topics":["dns-prefetch","preconnect","prefetch","preload","resource-hints","webpack-plugin"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/Jarweb.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}},"created_at":"2020-03-24T07:22:28.000Z","updated_at":"2023-09-11T08:03:05.000Z","dependencies_parsed_at":"2023-02-04T08:17:24.529Z","dependency_job_id":null,"html_url":"https://github.com/Jarweb/resourcehints-webpack-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jarweb%2Fresourcehints-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jarweb%2Fresourcehints-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jarweb%2Fresourcehints-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jarweb%2Fresourcehints-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jarweb","download_url":"https://codeload.github.com/Jarweb/resourcehints-webpack-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252978684,"owners_count":21834913,"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":["dns-prefetch","preconnect","prefetch","preload","resource-hints","webpack-plugin"],"created_at":"2025-01-25T07:13:51.075Z","updated_at":"2025-05-08T00:47:19.074Z","avatar_url":"https://github.com/Jarweb.png","language":"JavaScript","readme":"## install\nsupport webpack 4x\n```\nnpm i @jarzzzi/resourcehints-webpack-plugin --save-dev\n```\n\n## plugin options\n+ excludeHtml\n  - {Array\u003cstring\u003e}|undefined\n  - 排除的 html 页面\n+ exclude\n  - {Array\u003cstring\u003e}|undefined\n  - 排除的 chunk\n+ includ\n  - string|{Array\u003cstring\u003e}|undefined\n  - all\n  - initial\n  - async\n  - 指定的 chunk\n+ rel\n  - string\n  - dns-prefetch\n  - preconnect\n  - preload\n  - prefetch\n+ as\n  - string\n  - image, font, style, script, fetch, audio, video, worker, document, object, embed, track\n  - 相应的 as\n\n## about resource hints\n- dns-prefetch： 提前解析 dns\n- preconnect： 提前链接\n- preload： 提前加载当前页面资源\n- prefetch： 当前页面空闲时，提前加载下一页面资源\n- prerender： chrome 已废弃\n- subresource： chrome 已废弃\n\n## demo\n```\nnew ResourceHitWebpackPlugin({\n  rel: 'dns-prefetch',\n  include: [\n    '//www.baidu.com',\n  ],\n}),\nnew ResourceHitWebpackPlugin({\n  rel: 'preconnect',\n  include: [\n    '//www.baidu.com',\n  ],\n}),\nnew ResourceHitWebpackPlugin({\n  rel: 'prefetch',\n  exclude: ['chunk-one'],\n}),\nnew ResourceHitWebpackPlugin({\n  rel: 'preload',\n  include: 'async',\n  exclude: ['chunk-one'],\n}),\nnew ResourceHitWebpackPlugin({\n  rel: 'preload',\n  include: 'initial',\n  exclude: ['chunk-one'],\n  excludeHtml: ['demo-page'],\n}),\nnew ResourceHitWebpackPlugin({\n  rel: 'preload',\n  include: 'all',\n  exclude: ['chunk-one'],\n  excludeHtml: ['demo-page'],\n}),\nnew ResourceHitWebpackPlugin({\n  rel: 'preload',\n  as: 'script',\n  include: ['vendor', 'polyfill', 'common-lib'],\n}),\nnew ResourceHitWebpackPlugin({\n  rel: 'preload',\n  as: 'font',\n  include: ['yahei'],\n}),\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjarweb%2Fresourcehints-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjarweb%2Fresourcehints-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjarweb%2Fresourcehints-webpack-plugin/lists"}