Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/ratchet.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@gmail.com>2015-04-26 16:20:12 +0300
committerXhmikosR <xhmikosr@gmail.com>2015-04-26 16:20:12 +0300
commit70021410f9e2b3ae5f8f8239fd323342461ca1d5 (patch)
treeeb68623e623935042b90e74a19f265ce3d7c48a4
parente7b8fdfdb33a6f41a33f1e65bb3af7bf9d15189a (diff)
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.
-rw-r--r--Gruntfile.js49
-rw-r--r--package.json2
2 files changed, 50 insertions, 1 deletions
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",