# html-prefetch-webpack-plugin **Repository Path**: zc-lee/html-prefetch-webpack-plugin ## Basic Information - **Project Name**: html-prefetch-webpack-plugin - **Description**: 🚀🚀如果你想在浏览器空闲时段加载一些较大的资源,那么你可以使用此插件(You can use this plugin if you want to load large resources during idle browser hours) - **Primary Language**: JavaScript - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2022-02-23 - **Last Updated**: 2022-02-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ![node](https://img.shields.io/node/v/html-prefetch-webpack-plugin.svg) ![npm](https://img.shields.io/npm/dw/html-prefetch-webpack-plugin.svg) [![GitHub forks](https://img.shields.io/github/forks/hejialianghe/html-prefetch-webpack-plugin.svg?style=flat-square)](https://github.com/hejialianghe/Senior-FrontEnd/network) [![GitHub stars](https://img.shields.io/github/stars/hejialianghe/html-webpack-plugin.svg?style=flat-square)](https://github.com/hejialianghe/Senior-FrontEnd/stargazers) [![GitHub issues](https://img.shields.io/github/issues/hejialianghe/html-webpack-plugin.svg?style=flat-square)](https://github.com/hejialianghe/Senior-FrontEnd/issues) [![GitHub last commit](https://img.shields.io/github/last-commit/hejialianghe/html-webpack-plugin.svg?style=flat-square)](https://github.com/hejialianghe/Senior-FrontEnd/commits/master)

Html Prefetch Webpack Plugin

If you want to load some large resources during the browser's idle time, you can use this plugin. Prefetch works for non-first screen loading; Preload applies to the first screen loading

如果你想在浏览器空闲时段加载一些较大的资源,那么你可以使用此插件,prefetch适用于非首屏加载;preload适用于首屏加载

## Install ```bash npm i html-prefetch-webpack-plugin -D # or yarn add html-prefetch-webpack-plugin -D ``` ## Example before: ```html Webpack App ``` after: ```js Webpack App + ``` ### webpack config ```diff const HtmlPrefetchWebpackPlugin = require('html-prefetch-webpack-plugin') plugins:[ new htmlWwebpackPlugin(), + new HtmlPrefetchWebpackPlugin({ + rel:'prefetch', + include:['big-file'] + }) ] ``` ## options | key(键)| value(值)| Default(默认值)| Description(备注)| | :-----: | :--------: | :------------: | :------: | | rel | 'prefetch' or 'preload' | null | Specify the type | | include | string[] | null | Chunk file names that need to be preread and preloaded |