Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Adds automatically resource hints to your html-files

License

NotificationsYou must be signed in to change notification settings

jantimon/resource-hints-webpack-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm versionDependency StatusBuild statusjs-semistandard-style

This is an extension plugin for thewebpack pluginhtml-webpack-plugin.

It adds automaticallyresource-hints to your html files toimprove 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 resource-hints-webpack-plugin

Install the plugin with yarn:

$ yarn add --dev resource-hints-webpack-plugin

Basic Usage

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp