 del           = require 'del'
 gulp          = require 'gulp'
 autoprefixer  = require 'gulp-autoprefixer'
+bourbon       = require 'node-bourbon'
 base64        = require 'gulp-base64'
-bourbon       = require 'node-bourbon'
 coffee        = require 'gulp-coffee'
 concat        = require 'gulp-concat'
 frontmatter   = require 'gulp-front-matter'

    console.log 'Generating production build'

  del config.destination, ->
    gulp.start ['css', 'js', 'assets', 'views']


gulp.task 'serve', ['build'], ->
  gulp.start 'webserver'
  gulp.start 'watch'

  console.log 'Watching for changes...'
  gulp.watch 'css/**/**', ['css']
  gulp.watch 'js/**/**', ['js']
  gulp.watch 'views/**/**', ['views']


gulp.task 'webserver', ->
  port = config.server_port || 8000
  gulp.src config.destination
    .pipe webserver
      livereload: config.livereload || true
      port: port


