Created
September 15, 2014 18:29
-
-
Save danielyogel/a0b24e0fc7f821a2dafe to your computer and use it in GitHub Desktop.
gulpfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* FILES | |
* */ | |
var unitTestFiles = 'dist/**/**.spec.js', | |
integrationTestFiles = 'dist/**/**.integSpec.js', | |
distJsFiles = 'dist/**/*.js', | |
es6files = 'es6/**/*.js'; | |
/* | |
* Directories | |
* */ | |
var distDirectory = 'dist/'; | |
/* | |
* OPTIONS | |
* */ | |
var mochaOpts = {reporter: 'spec'}, | |
traceurOpts = {sourceMaps: true, modules: 'commonjs'}; | |
/* | |
* ================= TASKS ====================================== | |
* */ | |
gulp.task('traceur', function () { | |
return gulp.src(es6files) | |
.pipe(traceur(traceurOpts)) | |
.pipe(gulp.dest(distDirectory)); | |
}); | |
gulp.task('unit-tests', function () { | |
return gulp.src(unitTestFiles, {read: false}) | |
.pipe(mocha(mochaOpts)); | |
}); | |
gulp.task('integration-tests', function () { | |
return gulp.src(integrationTestFiles, {read: false}) | |
.pipe(mocha(mochaOpts)); | |
}); | |
/* | |
* Watch task | |
* */ | |
gulp.task('watch', function () { | |
gulp.watch(es6files, ['traceur', 'unit-tests']); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment