Simple WebP Converter
A simple Strapi plugin that converts images to WebP format.
strapi-plugin-webp-converter
A plugin for Strapi that automatically converts uploaded images to the WebP format using the sharp library. It ensures that your images are optimized for web performance by leveraging the benefits of the WebP format.
Supported Strapi versions
- v5.x.x
NOTE: Strapi 4.x.x is not supported!
Installation
npm install strapi-plugin-webp-converter
or
yarn add strapi-plugin-webp-converter
Configuration
Enable the plugin
The plugin configuration is stored in a config file located at ./config/plugins.js|ts
.
Javascript configuration
1module.exports = ({ env }) => ({
2 // ...
3 'webp-converter': {
4 enabled: true,
5 config: {
6 // mimeTypes that converts to WebP. Default is ['image/png', 'image/jpeg', 'image/jpg']
7 mimeTypes: undefined,
8 options: {
9 // WebP options: https://sharp.pixelplumbing.com/api-output#webp
10 },
11 },
12 },
13});
or
Typescript configuration
1export default () => ({
2 // ...
3 'webp-converter': {
4 enabled: true,
5 config: {
6 // mimeTypes that converts to WebP. Default is ['image/png', 'image/jpeg', 'image/jpg']
7 mimeTypes: undefined,
8 options: {
9 // WebP options: https://sharp.pixelplumbing.com/api-output#webp
10 },
11 },
12 },
13});
Install now
npm install strapi-plugin-webp-converter
Create your own plugin
Check out the available plugin resources that will help you to develop your plugin or provider and get it listed on the marketplace.