diff options
| author | cenci0 <alchimist94@gmail.com> | 2015-02-05 01:29:51 +0100 |
|---|---|---|
| committer | cenci0 <alchimist94@gmail.com> | 2015-02-05 01:29:51 +0100 |
| commit | c9fe613404d6b745edb51a6b71d637f22234c862 (patch) | |
| tree | aa865b704274c82e4e913b901a56da4bad48ce0e | |
| parent | 5b77a4eaab418836820b2a0bad7c88f0b88136a0 (diff) | |
Minify output HTML code
- Minify HTML pages (using `grunt-contrib-htmlmin`)
- Fix minor display error (force encode of HTML entity)
| -rw-r--r-- | Gruntfile.js | 18 | ||||
| -rw-r--r-- | js/pomf.js | 3 |
2 files changed, 19 insertions, 2 deletions
diff --git a/Gruntfile.js b/Gruntfile.js index 18c6a8b..10e2b2b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -22,6 +22,22 @@ module.exports = function (grunt) { production: false, } }, + htmlmin: { + dist: { + options: { + removeComments: true, + collapseWhitespace: true, + conservativeCollapse: true, + removeEmptyAttributes: true + }, + files: [{ + expand: true, + cwd: 'dist/', + src: '**/*.html', + dest: 'dist/' + }] + } + }, uglify: { options: { banner: '/*! <%= pkg.name %> (<%= pkg.repository.url %>) @ <%= grunt.template.today("yyyy-mm-dd") %> */\n\n' @@ -85,5 +101,5 @@ module.exports = function (grunt) { grunt.loadNpmTasks('grunt-contrib-imagemin'); grunt.loadNpmTasks('grunt-contrib-copy'); - grunt.registerTask('default', ['mkdir', 'swig', 'cssmin', 'uglify', 'imagemin', 'copy']); + grunt.registerTask('default', ['mkdir', 'swig', 'htmlmin', 'cssmin', 'uglify', 'imagemin', 'copy']); }; @@ -135,7 +135,8 @@ $(function () { break case 413: uploadFiles.addClass('error completed') - totalName.html('onii-chan, y-your upload is t-too big…') + // Terrible work-around, but necessary since otherwise the '…' entity is left decoded + totalName.html($('<div/>').html('onii-chan, y-your upload is t-too big…').text()); break default: uploadFiles.addClass('error completed') |
