Skip to content

About

Responsive loader adapter with tinify

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

Responsive Loader Tinify Adapter

Using Tinify to compress/resize images for Responsive Loader webpack loader.

Code style

Install

npm install --save-dev responsive-loader-tinify-adapter

Usage

Tinify key

You will need an API key from Tinify

Responsive loader

// Webpack config
const {
  responsiveLoaderTinifyAdapter
} = require('responsive-loader-tinify-adapter');

const config = {
  ...
  module: {
    rules: [
       {
        test: /\.(jpg)$/,
        loader: 'responsive-loader',
        options: {
          name: '[name]-[width].[ext]',
          adapter: responsiveLoaderTinifyAdapter({
              tinifyKey: [YOUR_TINIFY_KEY]
          }) // You can limit this adapter only to run in production mode if you want to
        }
      }
    ]
  },
  ...
}

About

Responsive loader adapter with tinify

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages