image-tinify-loader

1.0.0 • Public • Published

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

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)

Package Sidebar

Install

npm i image-tinify-loader

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

3.98 kB

Total Files

3

Last publish

Collaborators

  • gtopia