GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Jarweb/resourcehints-webpack-plugin: a webpack@4x plugin for resource hints

BranchesTags
Open more actions menu

Latest commit

 

History

12 Commits
12 Commits

Folders and files

NameName
Last commit message
Last commit date
dist
dist
 
 
src
src
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 

Repository files navigation

install

support webpack 4x

npm i @jarzzzi/resourcehints-webpack-plugin --save-dev

plugin options

  • excludeHtml
    • {Array}|undefined
    • 排除的 html 页面
  • exclude
    • {Array}|undefined
    • 排除的 chunk
  • includ
    • string|{Array}|undefined
    • all
    • initial
    • async
    • 指定的 chunk
  • rel
    • string
    • dns-prefetch
    • preconnect
    • preload
    • prefetch
  • as
    • string
    • image, font, style, script, fetch, audio, video, worker, document, object, embed, track
    • 相应的 as

about resource hints

  • dns-prefetch: 提前解析 dns
  • preconnect: 提前链接
  • preload: 提前加载当前页面资源
  • prefetch: 当前页面空闲时,提前加载下一页面资源
  • prerender: chrome 已废弃
  • subresource: chrome 已废弃

demo

new ResourceHitWebpackPlugin({
  rel: 'dns-prefetch',
  include: [
    '//www.baidu.com',
  ],
}),
new ResourceHitWebpackPlugin({
  rel: 'preconnect',
  include: [
    '//www.baidu.com',
  ],
}),
new ResourceHitWebpackPlugin({
  rel: 'prefetch',
  exclude: ['chunk-one'],
}),
new ResourceHitWebpackPlugin({
  rel: 'preload',
  include: 'async',
  exclude: ['chunk-one'],
}),
new ResourceHitWebpackPlugin({
  rel: 'preload',
  include: 'initial',
  exclude: ['chunk-one'],
  excludeHtml: ['demo-page'],
}),
new ResourceHitWebpackPlugin({
  rel: 'preload',
  include: 'all',
  exclude: ['chunk-one'],
  excludeHtml: ['demo-page'],
}),
new ResourceHitWebpackPlugin({
  rel: 'preload',
  as: 'script',
  include: ['vendor', 'polyfill', 'common-lib'],
}),
new ResourceHitWebpackPlugin({
  rel: 'preload',
  as: 'font',
  include: ['yahei'],
}),

About

a webpack@4x plugin for resource hints

Topics

dns-prefetchpreconnectprefetchpreloadresource-hintswebpack-plugin

Resources

Readme
Activity

Stars

4 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.