gruntjs / grunt-contrib-imagemin

Minify PNG, JPG, GIF and SVG images.
https://gruntjs.com
MIT License
1.21k stars 175 forks source link

Imagemin for a different levels #371

Closed olegdon closed 7 years ago

olegdon commented 8 years ago

Hi everyone, I have a question regarding imagemin. I have 2 folders on a different level. Is it possible to optimize more than one folder? For example now i have this setup: imagemin: { jpg: { options: { optimizationLevel: 5 }, files: [ { expand: true, cwd: 'images/', src: ['*/.jpg'], dest: 'images/', ext: '.jpg' } ] }, png: { options: { optimizationLevel: 5 }, files: [ { expand: true, cwd: 'images/', src: ['*/.png'], dest: 'images/', ext: '.png' } ] } }

Can I do something like: { expand: true, cwd: 'images/', '../../images/' src: ['*/.jpg'], dest: 'images/', '../../images' ext: '.jpg' }

sindresorhus commented 7 years ago

This is a general Grunt question and not specific to this task. Try asking on Stack Overflow.