From 877982732ac2412d0ac2b80a3c385d411a497e77 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 13 Feb 2014 08:00:47 +0000 Subject: [PATCH] Dev tools: Add `grunt imagemin:core` task for optimizing images pre-commit. Adds grunt-contrib-imagemin, so an `npm install` will be required. props jorbin, wonderboymusic for initial patches. see #25169. git-svn-id: https://develop.svn.wordpress.org/trunk@27172 602fd350-edb4-49c9-b593-d223f7449a82 --- Gruntfile.js | 13 ++++++++++++- package.json | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index bf5d12e17f..8d9f9c9e79 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -303,7 +303,7 @@ module.exports = function(grunt) { } }, jsvalidate:{ - options:{ + options: { globals: {}, esprimaOptions:{}, verbose: false @@ -317,6 +317,17 @@ module.exports = function(grunt) { } } }, + imagemin: { + core: { + expand: true, + cwd: SOURCE_DIR, + src: [ + 'wp-{admin,includes}/images/**/*.{png,jpg,gif,jpeg}', + 'wp-includes/js/tinymce/skins/wordpress/images/*.{png,jpg,gif,jpeg}' + ], + dest: SOURCE_DIR + } + }, watch: { all: { files: [ diff --git a/package.json b/package.json index e623764bca..2fc8050332 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "grunt-cssjanus": "~0.2.2", "grunt-sass": "~0.10.0", "grunt-jsvalidate": "~0.2.2", + "grunt-contrib-imagemin" : "~0.4.1", "matchdep": "~0.3.0" } }