Html Resource Hints Plugin
This is an extension plugin for the webpack plugin html-webpack-plugin.
It adds automatically resource-hints to your html files to improve your load time.
Installation
You must be running webpack on node 0.12.x or higher
Install the plugin with npm:
$ npm install --save-dev html-resource-hints-plugin
Install the plugin with yarn:
$ yarn add --dev html-resource-hints-plugin
Basic Usage
Add the plugin to your webpack config as follows:
plugins:
The above configuration will actually do the same as the following:
plugins: prefetch: '*.*' preload: '*.*'
Even if you generate multiple files make sure that you add the HtmlRessourceHintPlugin only once:
plugins: prefetch: '*.js' 'data.json' preload: '*.*' preload: '*.json' preload: false filename: 'demo.html'