Skip to content

ixlei/tinypng-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tinypng-webpack-loader

Install

npm install --save-dev tinypng-webpack-loader

Usage

Compress images size is a good way to improve page load speed,as the png format images, we can use Tinypng reduce the images size.
tinypng-webpack-loader is a webpack loader help to reduce your png images size. config as follows:

webpack.config.js

  {
    test: /\.(jpeg|png)$/,
    use: [
        // ...
        {
            loader: 'tinypng-webpack-loader',
            options: {
                proxy: /**http:your.proxy.com:port*/,
                cachePath: /**cache path*/,
                keys: [/**your tinypng key*/]
            }
        }
    ]
}

Options

Allowed values are as follows

Name Type Default Description
proxy {String} `` the request to tinypng proxy
cachePath {String} `` cache the tinypng reduce result
keys {Array<String>} available keys list

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published