1

I'm trying to use grunt-contrib-imagemin to recursively process a directory of images. Config looks like this:

    imagemin: {
        mytarget: {
            options: {
                optimizationLevel: 7
            },
            files: [{
                expand: true,
                cwd: '../../uploads',
                src: '{,*/}*.{png,jpg,jpeg}',
                dest: '.tmp/uploads'
            }]
        }
    }

In this form it only processes one sub-directory of the 'uploads' folder. I can't see what I'm doing wrong, can anyone spot my dumb mistake?

Thanks,

Toby

toby1kenobi
  • 1,609
  • 1
  • 14
  • 24

1 Answers1

3

Have you tried src: '**/*.{png,jpg,jpeg}', instead of src: '{,*/}*.{png,jpg,jpeg}',?

Please see here for more details.

eqot
  • 671
  • 6
  • 6