From 70021410f9e2b3ae5f8f8239fd323342461ca1d5 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Sun, 26 Apr 2015 16:20:12 +0300 Subject: Add grunt-contrib-compress and grunt-contrib-htmlmin. The former is used to create the release ZIP and the latter is used for minifying the GitHub docs only. --- Gruntfile.js | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- package.json | 2 ++ 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index c4e997c..2987ff0 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -250,7 +250,34 @@ module.exports = function (grunt) { }, jekyll: { - docs: {} + options: { + config: '_config.yml' + }, + docs: {}, + github: { + options: { + raw: 'github: true' + } + } + }, + + htmlmin: { + dist: { + options: { + collapseWhitespace: true, + conservativeCollapse: true, + minifyCSS: true, + minifyJS: true, + removeAttributeQuotes: true, + removeComments: true + }, + expand: true, + cwd: '_site', + dest: '_site', + src: [ + '**/*.html' + ] + } }, jshint: { @@ -337,6 +364,25 @@ module.exports = function (grunt) { port: 8000 } } + }, + + compress: { + main: { + options: { + archive: 'ratchet-<%= pkg.version %>-dist.zip', + mode: 'zip', + level: 9, + pretty: true + }, + files: [ + { + expand: true, + cwd: 'dist/', + src: ['**'], + dest: 'ratchet-<%= pkg.version %>-dist' + } + ] + } } }); @@ -353,6 +399,7 @@ module.exports = function (grunt) { grunt.registerTask('default', ['dist']); grunt.registerTask('test', ['dist', 'csslint', 'jshint', 'jscs', 'validate-html']); grunt.registerTask('server', ['dist', 'jekyll', 'connect', 'watch']); + grunt.registerTask('prep-release', ['dist', 'jekyll:github', 'htmlmin', 'compress']); grunt.registerTask('build-ratchicons-data', generateRatchiconsData); diff --git a/package.json b/package.json index a359b47..607bcf4 100644 --- a/package.json +++ b/package.json @@ -30,11 +30,13 @@ "grunt-autoprefixer": "~3.0.0", "grunt-banner": "~0.3.1", "grunt-contrib-clean": "~0.6.0", + "grunt-contrib-compress": "~0.13.0", "grunt-contrib-concat": "~0.5.1", "grunt-contrib-connect": "~0.10.1", "grunt-contrib-copy": "~0.8.0", "grunt-contrib-csslint": "~0.4.0", "grunt-contrib-cssmin": "~0.12.2", + "grunt-contrib-htmlmin": "~0.4.0", "grunt-contrib-jshint": "~0.11.2", "grunt-contrib-sass": "~0.9.2", "grunt-contrib-uglify": "~0.9.1", -- cgit v1.2.3