responsive-loader-tinify-adapter
v1.0.2
Published
Tinify adapter for webpack responsive loader
Downloads
3
Readme
Using Tinify to compress/resize images for Responsive Loader webpack loader.
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
}
}
]
},
...
}