twitch-speak
Version:
T H I S L I B R A R Y D E F I E S D E S C R I P T I O N B O Y S
47 lines (36 loc) • 905 B
JavaScript
;
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var mocha = require('gulp-mocha');
var options = {
'library': {
'sources': [
'./src/lib/**/*.js'
],
'tests': [
'./test/unit/lib/**/*.js'
],
'buildDir': './dist/',
'buildFile': 'twitch-speak.js'
}
};
function buildLibrary() {
gulp.src(options.library.sources)
.pipe(uglify())
.pipe(concat(options.library.buildFile))
.pipe(gulp.dest(options.library.buildDir));
}
function testUnit() {
return gulp.src(options.library.tests)
.pipe(mocha({
'reporter': 'nyan'
}));
}
function watchForTests() {
gulp.watch([options.library.sources, options.library.tests], ['test-unit']);
}
gulp.task('test-unit', testUnit);
gulp.task('test', ['test-unit']);
gulp.task('watch', watchForTests);
gulp.task('build', buildLibrary);