1.0.0 • Published 6 years ago
image-tinify-loader v1.0.0
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: /\.(gif|png|jpe?g)$/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
1.0.0
6 years ago