fannypack-images
Official Fannypack task for minifying images for production.
Installation
npm install fannypack-images --save-dev
Usage
// gulpfile.js var Fannypack = FannypackConfigimages = // Config.root.src + 'src' dir src: 'img' // Config.root.dest + 'dest' dir dest: 'assets/img' // Auto-run this task in dev mode? watchTask: true assetTask: true // flatten all images to destination folder? flatten: true // File extensions to watch extensions: 'jpg' 'png' 'svg' 'gif' Fannypack
Flattening
If set to true, images within src/assets/img/home/*.jpg
, src/assets/img/app/*.jpg
and src/assets/img/*.jpg
will ALL be merged into build/assets/img/*.jpg
without retaining the subdirectories home
and app
.
If you want to keep any subdirectories, set flatten
to false
.