Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added grunt contrib imagemin #46

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,24 @@ module.exports = function (grunt) {
}
},

/**
* Minifies PNG and JPG images
* https://github.com/gruntjs/grunt-contrib-imagemin
*/
imagemin:{
static: {
options: {
optimizationLevel: 3
},
files: [{
expand: true, // Enable dynamic expansion
cwd: '<%= project.src %>/images', // Src matches are relative to this path
src: ['**/*.{png,jpg,gif}'], // Actual patterns to match
dest: '<%= project.assets %>/img/'// Destination path prefix
}]
}
},

/**
* Runs tasks against changed watched files
* https://github.com/gruntjs/grunt-contrib-watch
Expand Down Expand Up @@ -217,6 +235,7 @@ module.exports = function (grunt) {
grunt.registerTask('build', [
'sass:dist',
'jshint',
'imagemin',
'uglify'
]);

Expand Down
Binary file added app/assets/img/abstract.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"grunt-contrib-watch": "~0.4.4",
"connect-livereload": "~0.2.0",
"grunt-open": "~0.2.0",
"matchdep": "~0.1.2"
"matchdep": "~0.1.2",
"grunt-contrib-imagemin": "~0.3.0"
}
}
Binary file added src/images/abstract.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.