1.0.0 • Published 6 years ago

image-tinify-loader v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

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

Documentation: Using loaders

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

NameTypeDefaultDescription
quiet{Boolean}truePrevent output information
keys{Array}undefinedAPI keys

License

MIT (http://www.opensource.org/licenses/mit-license.php)