"use strict";

var gulp     = require('./parent-gulp');
var del      = require('del');

var defineTask = require('./define-task');
require('./browserify-compile');
require('./serve');
require('./styles');
require('./testing');
require('./views');

// TODO: add support for creating bundles with hash file names using gulp-rev-all

var settings = require('./settings');

defineTask('build', ['browserify:bundle', 'styles:build', 'views:build']);

defineTask('watch', ['browserify:watch', 'styles:watch', 'views:watch']);

defineTask('clean', function (cb) {
    del(settings.paths.output, cb);
});

defineTask('default', ['clean'], function () {
    return gulp.start('serve');
});

"use strict";

var gulp     = require('./parent-gulp');
var del      = require('del');
var revall   = require('gulp-rev-all');
var path     = require('path');

var defineTask = require('./define-task');
require('./browserify-compile');
require('./serve');
require('./styles');
require('./testing');
require('./views');

var settings = require('./settings');

defineTask('build', ['build:static']);

defineTask('build:static', ['browserify:bundle', 'styles:build', 'views:build']);

defineTask('build:optimized', ['build:static'], function () {
    return gulp.src(path.join(settings.paths.output, 'static/**'))
        .pipe(revall({ ignore: [/^index.html$/] }))
        .pipe(gulp.dest(path.join(settings.paths.output, 'optimized')));
});

defineTask('watch', ['browserify:watch', 'styles:watch', 'views:watch']);

defineTask('clean', function (cb) {
    del(settings.paths.output, cb);
});

defineTask('default', ['clean'], function () {
    return gulp.start('serve');
});

Support creating build with hashed filenames.
Support creating build with hashed filenames.
