diff --git a/Gruntfile.js b/Gruntfile.js index e4a8781..88ea6d0 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -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 @@ -217,6 +235,7 @@ module.exports = function (grunt) { grunt.registerTask('build', [ 'sass:dist', 'jshint', + 'imagemin', 'uglify' ]); diff --git a/app/assets/img/abstract.png b/app/assets/img/abstract.png new file mode 100644 index 0000000..a09f607 Binary files /dev/null and b/app/assets/img/abstract.png differ diff --git a/package.json b/package.json index e4fed31..880a034 100644 --- a/package.json +++ b/package.json @@ -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" } } diff --git a/src/images/abstract.png b/src/images/abstract.png new file mode 100644 index 0000000..9a2f49b Binary files /dev/null and b/src/images/abstract.png differ