You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
596 B
JavaScript
23 lines
596 B
JavaScript
'use strict';
|
|
|
|
var loggerPartial = require("@joepie91/gulp-partial-logger");
|
|
var livereloadPartial = require("@joepie91/gulp-partial-livereload");
|
|
|
|
var cache = require("gulp-cached");
|
|
var babel = require("gulp-babel");
|
|
|
|
module.exports = function (options) {
|
|
var cacheKey = options.cacheKey != null ? options.cacheKey : "preset";
|
|
|
|
var streamList = [cache(cacheKey), babel({ presets: ["es2015"] })];
|
|
|
|
if (options.livereload != null) {
|
|
streamList.push(livereloadPartial(options.livereload));
|
|
}
|
|
|
|
return loggerPartial("babel", streamList, {
|
|
logger: {
|
|
basePath: options.basePath
|
|
}
|
|
});
|
|
}; |