'use strict'; const loggerPartial = require("@joepie91/gulp-partial-logger"); const livereloadPartial = require("@joepie91/gulp-partial-livereload"); const xtend = require("xtend"); const cache = require("gulp-cached"); const pegjs = require("gulp-peg"); module.exports = function(options) { let cacheKey = (options.cacheKey != null) ? options.cacheKey : "preset"; let pegjsOptions = (options.pegjs != null) ? options.pegjs : {}; let streamList = [ cache(cacheKey), pegjs(pegjsOptions) ]; if (options.livereload != null) { streamList.push(livereloadPartial(options.livereload)); } return loggerPartial("pegjs", streamList, { logger: { basePath: options.basePath } }); }