WebP Convertor
CLI
Script to convert images to webp, compress and resize to reduce their size and improve loading speed in browsers. Everything completely configurable through a JSON file.
Source
View source code
Package
@codeleap/cli
How to use
First you need to have a JSON file in the project root with the following name: codeleapcli.config.json.
JSON Example
{"convertor-webp": {"input": "./src/app/assets/images","output": "./src/app/assets/images_webp","convertor": {"compressionQuality": 50,"resizeWidth": 1000,"processColorChannels": true,"inputFormats": ["png", "jpeg"],"ignoreFiles": ["home"]},"mode": "multi"}}
Settings
Run command
Open the terminal and type:
yarn codeleap convertor-webp
The conversion process will happen automatically, and any configuration errors will be shown in the terminal.