- Notifications
You must be signed in to change notification settings - Fork16
Adds automatically resource hints to your html-files
License
jantimon/resource-hints-webpack-plugin
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This is an extension plugin for thewebpack pluginhtml-webpack-plugin.
It adds automaticallyresource-hints to your html files toimprove your load time.
You must be running webpack on node 0.12.x or higher
Install the plugin with npm:
$ npm install --save-dev resource-hints-webpack-plugin
Install the plugin with yarn:
$ yarn add --dev resource-hints-webpack-plugin
Load the plugin
constResourceHintWebpackPlugin=require('resource-hints-webpack-plugin');
and add it to your webpack config as follows:
plugins:[newHtmlWebpackPlugin(),newResourceHintWebpackPlugin()]
The above configuration will actually do the same as the following:
plugins:[newHtmlWebpackPlugin({prefetch:['**/*.*'],preload:['**/*.*']}),newResourceHintWebpackPlugin()]
Even if you generate multiple files make sure that you add the ResourceHintWebpackPluginonly once:
plugins:[newHtmlWebpackPlugin({prefetch:['*.js','data.json'],preload:'*.*'}),newHtmlWebpackPlugin({preload:['*.json'],preload:false,filename:'demo.html'}),newResourceHintWebpackPlugin()]
About
Adds automatically resource hints to your html-files
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.