Engulped provides utilities for defining some common build build tasks for es6 using babel and mocha. I kept needing the same tasks in many of my projects, so this tool makes it possible to add each in as needed.
The most common usage is to add all the default tasks. To do so, your gulpfile would look like the following
var gulp = require('gulp')
var Engulped = require('engulped')
var engulped = Engulped.withDefaultTasks(gulp)
gulp.task('default',['test','build'])
This automatically adds many tasks to gulp. The default task added uses the added tasks oo run all specs with mocha and transpiles to es6 to es5.
You can then optionally overwrite them as needed
gulp.task('clean',function(){
console.log('feeling clean')
})
You can also reference the original function used to generate the tasks via the -tasks- method. For example, here’s how you’d overwrite clean with the same implementation:
var tasks = engulped.tasks()
gulp.task('clean',tasks.clean())
Some taskbuilding functions have parameters they accept, take a look at -lib/addDefaultTasks.js- and -lib/taskBuilders- for more information.
Cleans the directory of files created by transpiling
Transpile source files in -src- from es6 to es5 (src -> dest) (via babel)
Run all specs in test directory (es6 registered) (via mocha)
Runs the default task on any file changes (via nodemon)
Then you can create it with the constructor instead, and add them manually
var gulp = require('gulp')
var Engulped = require('engulped')
var engulped = new Engulped(gulp)
var tasks = engulped.tasks()
gulp.task('clean',tasks.clean())
You can pass a configuration as the second parameter to the constructor or Engulped.withDefaultTasks. The default config looks something like:
{argv : process.argv,
paths : {
script : {
src : './lib/',
dest : './dist/',
pattern : '/**/*.js'
},
test : {
src : './test/',
pattern : '/**/**Spec.js'
}
}