Webpack loader that converts JPEG and PNG images to WebP format using imagemin-webp under the hood. Version 0.6.0 is the latest stable release. The loader integrates with webpack's loader pipeline and is typically combined with file-loader or multi-loader to produce both original and WebP versions. Key differentiator: it provides a direct bridge between webpack and imagemin-webp, allowing configuration via query string. However, it has seen only sporadic updates and is largely superseded by more modern image optimization plugins like imagemin-webpack-plugin.
npm install webp-loaderVerified import paths — ran on the pinned version, not inferred.
Shows basic webpack config to convert images to WebP using webp-loader alongside file-loader, including passing options.
Consider migrating to imagemin-webpack-plugin or sharp-based solutions.
Use multi-loader to apply two loader pipelines as shown in README.
Use object format via options property in webpack config.
Pin webpack version to 4 or manually adjust loader; consider migration.
Run npm install webp-loader --save-dev
Install webpack and webpack-cli: npm install webpack webpack-cli --save-dev
Use the options object in webpack config: { loader: 'webp-loader', options: { quality: 80 } }