image-tinify-loader
Image loader module for webpack
.
Compress images with tinify-nodejs
Install
$ npm i image-tinify-loader -D
Usage
Apply API key
Apply at least one API key at tinypng.com
Config loader
In your webpack.config.js
, add the image-loader, chained after the file-loader:
rules: test: /\.$/i use: 'file-loader' loader: 'image-tinify-loader' options: quiet: false keys: 'your_API_key1' 'your_API_key2'
Options
Name | Type | Default | Description |
---|---|---|---|
quiet |
{Boolean} |
true |
Prevent output information |
keys |
{Array} |
undefined |
API keys |
License
MIT (http://www.opensource.org/licenses/mit-license.php)