{"library":"preload-webpack-plugin","title":"preload-webpack-plugin","description":"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.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install preload-webpack-plugin"],"cli":null},"imports":["const PreloadWebpackPlugin = require('preload-webpack-plugin');","import PreloadWebpackPlugin from 'preload-webpack-plugin';","new PreloadWebpackPlugin({ rel: 'preload', include: 'asyncChunks' })"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const HtmlWebpackPlugin = require('html-webpack-plugin');\nconst PreloadWebpackPlugin = require('preload-webpack-plugin');\n\nmodule.exports = {\n  entry: './src/index.js',\n  output: { filename: '[name].[hash].js' },\n  plugins: [\n    new HtmlWebpackPlugin(),\n    new PreloadWebpackPlugin({\n      rel: 'preload',\n      include: 'asyncChunks',\n      fileWhitelist: [/\\/dist\\/.*\\.js/]\n    })\n  ]\n};","lang":"javascript","description":"Configure webpack to preload async chunks via html-webpack-plugin.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}