https://github.com/ixlei/tinypng-loader
https://github.com/ixlei/tinypng-loader
loader tinypng webpack
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/ixlei/tinypng-loader
- Owner: ixlei
- Created: 2018-06-09T14:27:51.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-13T11:58:34.000Z (about 8 years ago)
- Last Synced: 2025-02-12T12:51:52.545Z (over 1 year ago)
- Topics: loader, tinypng, webpack
- Language: JavaScript
- Size: 460 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
tinypng-webpack-loader
Install
```bash
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](https://tinypng.com/) reduce the images size.
`tinypng-webpack-loader` is a webpack loader help to reduce your png images size.
config as follows:
**webpack.config.js**
```javascript
{
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}`||available keys list|