Skip to content

Instantly share code, notes, and snippets.

@cbourdage
Created April 13, 2015 18:27
Show Gist options
  • Save cbourdage/2ad20f835f047323be68 to your computer and use it in GitHub Desktop.
Save cbourdage/2ad20f835f047323be68 to your computer and use it in GitHub Desktop.
sample grunt configuration for image minification
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
imagemin: {
skinpng: {
options: {
progressive: 6
},
files: [{
expand: true,
cwd: Config.assetsRoot + 'images/',
src: ['**/*.png'],
dest: Config.assetsRoot + 'images/',
ext: '.png'
}]
},
skinjpg: {
options: {
progressive: true
},
files: [{
expand: true,
cwd: Config.assetsRoot + 'images/',
src: ['**/*.jpg'],
dest: Config.assetsRoot + 'images/',
ext: '.jpg'
}]
},
wysiwygpng: {
options: {
progressive: 6
},
files: [{
expand: true,
cwd: 'media/wysiwyg/',
src: ['**/*.png'],
dest: 'media/wysiwyg/',
ext: '.png'
}]
},
wysiwygjpg: {
options: {
progressive: true
},
files: [{
expand: true,
cwd: 'media/wysiwyg/',
src: ['**/*.jpg'],
dest: 'media/wysiwyg/',
ext: '.jpg'
}]
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment