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.

28 lines
696 B
JavaScript

'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
}
});
}