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.
32 lines
760 B
JavaScript
32 lines
760 B
JavaScript
8 years ago
|
'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 riot = require("gulp-riot");
|
||
|
|
||
|
module.exports = function(options) {
|
||
|
let cacheKey = (options.cacheKey != null) ? options.cacheKey : "preset";
|
||
|
let riotOptions = (options.riot != null) ? options.riot : {};
|
||
|
|
||
|
let streamList = [
|
||
|
cache(cacheKey),
|
||
|
riot(xtend({
|
||
|
type: "babel",
|
||
|
template: "jade",
|
||
|
style: "scss"
|
||
|
}, riotOptions))
|
||
|
];
|
||
|
|
||
|
if (options.livereload != null) {
|
||
|
streamList.push(livereloadPartial(options.livereload));
|
||
|
}
|
||
|
|
||
|
return loggerPartial("riot", streamList, {
|
||
|
logger: {
|
||
|
basePath: options.basePath
|
||
|
}
|
||
|
});
|
||
|
}
|