var gulp        = require('gulp');
var exec        = require('child_process').exec;
var del         = require('del');
var runSequence = require('run-sequence');

var $ = require('gulp-load-plugins')();

var PATH = {
    src   : 'src',
    dev   : 'dev',
    build : 'build'
};

// For development
gulp.task('clean:dev', function () {
    return del([
        PATH.dev
    ]);
});

gulp.task('babel:dev', function () {
    return gulp.src(PATH.src + '/**/*.js')
        .pipe($.sourcemaps.init())
            .pipe($.babel())
        .pipe($.sourcemaps.write())
        .pipe(gulp.dest(PATH.dev));
});

gulp.task('dev', function (callback) {
    return runSequence(
        'clean:dev',
        'babel:dev',
        function () {
            gulp.watch(PATH.src + '/**/*.js', ['babel:dev']);
            callback && callback();
        }
    );
});

// For build
gulp.task('clean:build', function () {
    return del([
        PATH.build
    ]);
});

gulp.task('babel:build', function () {
    return gulp.src(PATH.src + '/**/*.js')
        .pipe($.babel())
        .pipe($.uglify())
        .pipe($.concat('color.min.js'))
        .pipe(gulp.dest(PATH.build));
});

gulp.task('default', function (callback) {
    return runSequence(
        'clean:build',
        'babel:build',
        callback
    );
});

@@ -32,57 +32,8 @@
 ');%0A
-var exec        = require('child_process').exec;%0A
 var 

Remove unused require.