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.

25 lines
677 B
JavaScript

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