b852be15 by Adam Heath

Add compression support.

For each file matching a list of supplied extensions, gzip will be used
to write a compressed copy, and placed along side the original.
1 parent 59c643b8
......@@ -717,6 +717,18 @@ module.exports = function (grunt) {
}
};
}
if (mpConfig.gzip) {
initConfig.compress = {
dist: {
options: {
mode: 'gzip',
},
files: _.map(mpConfig.gzip.options.extensions, function(value) {
return {expand: true, cwd: 'dist/build', src: ['**/*.' + value], dest: 'dist/build', extDot: 'last', ext: '.' + value + '.gz'};
}),
},
};
}
grunt.initConfig(initConfig);
grunt.config('montyPython.config', mpConfig);
......@@ -846,6 +858,9 @@ module.exports = function (grunt) {
}
buildList.push('do-use');
buildList.push('htmlmin'); // montyPython
if (mpConfig.gzip) {
buildList.push('compress:dist');
}
buildList.push('deploy'); // montyPython
grunt.task.run(buildList);
......
......@@ -18,6 +18,7 @@
"grunt": "",
"grunt-contrib-clean": "",
"grunt-contrib-concat": "",
"grunt-contrib-compress": "",
"grunt-contrib-copy": "",
"grunt-contrib-csslint": "",
"grunt-contrib-cssmin": "",
......