https://github.com/glebmachine/image-optimize-loader
Optimize images with global caching and convert of non-transparent png to jpg (on the fly)
https://github.com/glebmachine/image-optimize-loader
Last synced: about 1 month ago
JSON representation
Optimize images with global caching and convert of non-transparent png to jpg (on the fly)
- Host: GitHub
- URL: https://github.com/glebmachine/image-optimize-loader
- Owner: glebmachine
- Created: 2016-06-24T06:59:40.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-31T21:48:30.000Z (almost 8 years ago)
- Last Synced: 2023-03-22T12:35:31.341Z (about 2 years ago)
- Language: JavaScript
- Homepage:
- Size: 372 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 117
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# image-optimize-loader [](https://travis-ci.org/glebmachine/image-optimize-loader) [](http://badge.fury.io/js/image-optimize-loader)
Optimize images with global caching and convert of non-transparent png to jpg (on the fly)
> Rework of https://github.com/tcoopman/image-webpack-loader## Features
- Opmitize images with `pngquant`/`mozjpeg`/`svgo` (like image-webpack-loader)
- Cache results into your OS `tmp` folder## Webpack 2.0 features
- Convert non-transparent `png` images into `jpg` (due up to 7x size reduction)## Install
```sh
$ npm install image-optimize-loader --save-dev
```## Usage
```js
loaders: [
{
test: /\.(jpe?g|png|gif|svg)$/i,
loaders: [
'file?hash=sha512&digest=hex&name=[hash].[ext]',
'image-optimize'
]
}
]
```## Configuration
```js
{ // default configuration example
imageOptimizeLoader: {
optimizer: {
covertPngToJpg:true
},
pngquant: {
quality: '65-80',
speed: 4
},
mozjpeg:{
targa: false,
},
svgo: {
plugins:[
{ removeComments: true },
{ sortAttrs: true },
{ minifyStyles: true },
]
}
}
```
## License
MIT (http://www.opensource.org/licenses/mit-license.php)