@coco-platform/webpack-plugin-network-hints
v1.0.0
Published
Inject network hints automatic, cooperate with html-webpack-plugin.
Downloads
7
Readme
network-hints
An extension plugin for the webpack plugin html-webpack-plugin.
Inject resource-hints into html, to improve your load time.
Installation
pre-requirement:
webpack >= 4.0.0
node >= 10.0.0
Install the plugin with npm:
$ npm install --save-dev @coco-platform/webpack-plugin-network-hints
Install the plugin with yarn:
$ yarn add --dev @coco-platform/webpack-plugin-network-hints
Usage
Load the plugin:
const {
NetworkHintsPlugin,
} = require('@coco-platform/webpack-plugin-network-hints');
and add it to your webpack config as follow:
plugins: [
new HtmlWebpackPlugin(),
new NetworkHintsPlugin({
prefetch: ['**/*.*'],
preload: ['**/*.*'],
}),
];
Licence
MIT