Browse Source

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.
pull/771/head
XhmikosR 10 years ago
parent
commit
70021410f9
  1. 49
      Gruntfile.js
  2. 2
      package.json

49
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);

2
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",

Loading…
Cancel
Save