Skip to content
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.

Gulp: Build

Dave Lunny edited this page Jan 18, 2015 · 5 revisions

##Build

gulp build

This is the 'build' or 'distribution' or 'production' or whatever you want to call it. This guy does a bunch of work to build you out a lean and clean app. It puts it all in the /build/ folder for you.

The process goes a little something like this:

  • starts by compiling all the LESS files
  • then concats the CSS, autoprefixes it, before finally combing it for stupid mistakes and then minifying it
  • then moves onto the JS by (if your using Angular in your project) prepping your code for minification using ng-annotate, concating all js files into one and then uglifying them
  • copy over any assets or partials (and make them validation-friendly if using Angular)
  • copy over main index.html file, while replacing the many links to external JS/CSS files with just the one for the JS file and one for the CSS files that were just created
  • runs uncss to see what css is not being used by the HTML file(s) and removes it.
  • perform a cleanup by deleting the tmp/ directory used to build the files

That's pretty much it! 😄