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.
26 lines
609 B
JavaScript
26 lines
609 B
JavaScript
'use strict';
|
|
|
|
const loggerPartial = require("@joepie91/gulp-partial-logger");
|
|
const livereloadPartial = require("@joepie91/gulp-partial-livereload");
|
|
|
|
const cache = require("gulp-cached");
|
|
const babel = require("gulp-babel");
|
|
|
|
module.exports = function(options) {
|
|
let cacheKey = (options.cacheKey != null) ? options.cacheKey : "preset";
|
|
|
|
let streamList = [
|
|
cache(cacheKey),
|
|
babel({presets: ["es2015"]})
|
|
];
|
|
|
|
if (options.livereload != null) {
|
|
streamList.push(livereloadPartial(options.livereload));
|
|
}
|
|
|
|
return loggerPartial("babel", streamList, {
|
|
logger: {
|
|
basePath: options.basePath
|
|
}
|
|
});
|
|
} |