Preload-webpack-plugin (v2.3.0) enhances html-webpack-plugin by adding link rel=preload and prefetch resource hints for scripts and other assets. It integrates with webpack 3 and is developed by Google Chrome Labs. The v3 alpha/beta branches add webpack 4 support and target node >= 6. Key differentiators: automatic preloading of async chunks, granular control via include/exclude options, and support for multiple HtmlWebpackPlugin instances. Unlike manual preloading, it covers all script types (initial, async, dynamic) with minimal config.
npm install preload-webpack-pluginVerified import paths — ran on the pinned version, not inferred.
Configure webpack to preload async chunks via html-webpack-plugin.
new PreloadWebpackPlugin({ rel: 'preload', ... })Upgrade node to version >=6, use html-webpack-plugin v4 or later.
Consider alternative like @vue/preload-webpack-plugin or use webpack 4.
Use `include: 'asyncChunks'` or `include: 'initial'` for scripts only.
Add a new PreloadWebpackPlugin for each HtmlWebpackPlugin.
Use v3.0.0 alpha/beta (npm install preload-webpack-plugin@next) or downgrade webpack to v3.
Add rel: 'preload' or rel: 'prefetch' to the plugin options.
Run npm install --save-dev html-webpack-plugin.