Now that we have minified and tested our JavaScript and got some work done using Gulp, we are going to do a fast forward and minify our HTML and CSS and bundle our scripts and replace the ones in our HTML files with the minified ones.
Getting our site production ready
Minifying HTML
First, let's start with minifying our HTML. There are various plugins you can use, but we will use HTML Minifier (https://www.npmjs.com/package/html-minifier). We will need the Gulp plugin, which will also install HTML Minifier (https://github.com/jonschlinkert/gulp-htmlmin):
npm install gulp-htmlmin --save-dev
The usage is quite simple:
var htmlmin = require('gulp-htmlmin');
gulp.task('minify-html', function() {
return...