Answer the question
In order to leave comments, you need to log in
Gulp vs BrowserSync bs.reload not working, how to fix?
the task is started via a lazy function:
'use strict';
const gulp = require('gulp');
const path = require('path');
module.exports = function lazyRequireTask(taskName, config) {
gulp.task(taskName, function(callback){
let task = require(path.resolve(`${config.taskPath}/${taskName}`)).call(this, config, taskName);
return task(callback);
});
};
'use strict';
const gulp = require('gulp');
const $ = require('gulp-load-plugins')();
const bs = require('browser-sync').create();
module.exports = function(config) {
return () => {
return gulp.src(`${config.pugPath}/pages/*.pug`)
.pipe($.pug({pretty: true}))
.pipe(gulp.dest(config.outPath))
.on('end', bs.reload);
}
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question