declarative use of imagemin \o/.
Features:
- image processing powered by imagemin
- image preprocessing powered by jimp
- will skip files, when the source and the config file are older then the target
npm install --save-dev imagemin-manager
// imagemin.config.js
module.exports = {
from: ["resources"],
to: "deploy/resources",
process: {
ico: "copy", // will match files with /.ico$/
jpg: require("imagemin-guetzli")({quality: 87})
}
preprocess: {// see jimp for available commands
jpg: [
["resize","AUTO",400]
]
}
}
# call in terminal:
imagemin-manager
// or use a task in your package.json
...
"scripts": {
...
"deploy:imagemin": "imagemin-manager"
...
}
...
Copyright (c) 2017 Paul Pflugradt Licensed under the MIT license.