https://github.com/coco-platform/network-hints
Adds resource hints into html file, see https://www.w3.org/TR/resource-hints/
https://github.com/coco-platform/network-hints
webpack webpack-plugin
Last synced: 2 months ago
JSON representation
Adds resource hints into html file, see https://www.w3.org/TR/resource-hints/
- Host: GitHub
- URL: https://github.com/coco-platform/network-hints
- Owner: coco-platform
- Created: 2017-09-09T04:59:28.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2025-06-16T18:12:03.000Z (about 1 year ago)
- Last Synced: 2025-10-02T15:31:39.185Z (9 months ago)
- Topics: webpack, webpack-plugin
- Language: JavaScript
- Homepage:
- Size: 2.78 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# network-hints

[](https://coveralls.io/github/coco-platform/?branch=master) [](https://greenkeeper.io/)


An extension plugin for the [webpack](http://webpack.github.io) plugin [html-webpack-plugin](https://github.com/ampedandwired/html-webpack-plugin).
Inject [resource-hints](https://www.w3.org/TR/resource-hints/) into html, to [improve your load time](https://hackernoon.com/10-things-i-learned-making-the-fastest-site-in-the-world-18a0e1cdf4a7#.ejrj8kvk9).
## Installation
pre-requirement:
```
webpack >= 4.0.0
node >= 10.0.0
```
Install the plugin with npm:
```shell
$ npm install --save-dev @coco-platform/webpack-plugin-network-hints
```
Install the plugin with yarn:
```shell
$ yarn add --dev @coco-platform/webpack-plugin-network-hints
```
## Usage
Load the plugin:
```javascript
const {
NetworkHintsPlugin,
} = require('@coco-platform/webpack-plugin-network-hints');
```
and add it to your webpack config as follow:
```javascript
plugins: [
new HtmlWebpackPlugin(),
new NetworkHintsPlugin({
prefetch: ['**/*.*'],
preload: ['**/*.*'],
}),
];
```
# Licence
MIT