Join Ray Villalobos for an in-depth discussion in this video Minifying our HTML, part of Gulp.js, Git, and Browserify: Web Project Workflows.
…Our production environment is looking pretty good, but if I peek into…the production folder, I'm going to notice…that there isn't any index.html file there.…Now, since we're minifying all the other code,…let's go ahead and add the plugin that…will take the index.html file from the Development…server and put it in production, compressed and minified.…So the plugin you need to use for that is called gulp-minify-html.…It has a few options that you pass along…as an object, just like any of the other plugins.…And we'll, of course, need to install it.…
We'll need to switch over to the terminal.…And we'll do an NPM, install --save-dev and do gulp-minify-html.…All right, let me clear that out, and of course,…we'll need to go into our gulp file once again.…Make sure we add a variable for this process.…So, this will be minifyHTML.…And will require the gulp-minify-html plugin here.…
And what we'll need to do is go into the task for html,…so that would be right here, and add a couple of conditional statements.…So we'll pipe this, then use the gulpif command or the gulp if…
- Why workflow management?
- Processing tasks with gulp-coffee
- Importing libraries with Browserify
- Processing Sass and Compass
- Issuing tasks in sequence
- Watching changes to files
- Adding static reloads
- Setting up environment variables
- Minifying HTML
- Compressing images
Skill Level Intermediate
Q: When using the exercise files with the "git add" command on a PC, why do I receive warnings saying "LF will be replaced by CRLF"?
A: When running Unix files on a Windows workstation, the text formats are not exactly the same. Line Feeds (LFs) have to be converted to "Carriage Returns + Line Feeds.”