An open API service indexing awesome lists of open source software.

https://github.com/dimitrinicolas/lepto-webp

Lepto plugin for creating webp alternatives
https://github.com/dimitrinicolas/lepto-webp

lepto lepto-plugin webp

Last synced: 8 months ago
JSON representation

Lepto plugin for creating webp alternatives

Awesome Lists containing this project

README

          

# lepto-webp

```console
$ npm i -D lepto-webp
```

See [lepto documentation](https://github.com/dimitrinicolas/lepto) for usage.

This plugin has no options, just add it to your plugins list.

Default options:
```js
"use": [
{
"name": "lepto-webp",
"quality": 80,
"alphaQuality": 100,
"lossless": false,
"replaceFile": false
}
]
```

## How to use .webp format

Since `.webp` files are not supported on all browser, you have to give them multiples ressources (like a `.jpg` and a `.webp`).

The simplest solution is to use the `` tag:

```html


```

Browsers that supports webp format will only load the webp file, the others will only load the jpg one.

You can learn even more with the [images.guide](https://images.guide/) by Addy Osmani.

## License

This project is licensed under the [MIT license](LICENSE).