Skip to content

Commit 3c7f48c

Browse files
authored
Merge pull request #930 from Rahulm2310/imagemin-fix
Fixed imagemin compression
2 parents 5c30484 + a25b455 commit 3c7f48c

File tree

3 files changed

+455
-208
lines changed

3 files changed

+455
-208
lines changed

Gruntfile.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ const fse = require('fs-extra');
1212
const git = require('simple-git');
1313
const pkg = require('./package.json');
1414
const update_i18n = require('./updatei18nFiles.js');
15+
const mozjpeg = require('imagemin-mozjpeg');
16+
const pngquant = require('imagemin-pngquant');
1517

1618
module.exports = function(grunt) {
1719
require('time-grunt')(grunt);
@@ -151,7 +153,8 @@ module.exports = function(grunt) {
151153
imagemin: {
152154
images: {
153155
options: {
154-
optimizationLevel: 2
156+
optimizationLevel: 2,
157+
use: [mozjpeg({quality: 70}), pngquant()] //plugins for jpeg & png image compression
155158
},
156159
files: [{
157160
expand: true,
@@ -502,4 +505,4 @@ module.exports = function(grunt) {
502505

503506
// runs with just grunt command
504507
grunt.registerTask('default', ['build']);
505-
};
508+
};

0 commit comments

Comments
 (0)