R
R
Ramil2017-08-29 14:14:39
Building projects
Ramil, 2017-08-29 14:14:39

Why do all pug files compile when only one changes?

I collect pug files. Reloading pages with browsersync. But the page takes a long time to load because browsersync until all the pug files are collected. Although only one pug file has been changed.

gulp.task(function templates(cb) {
    const data = require('./templates/data/data.json');
    gulp.src('/pages/**/*.pug')
        .pipe(plumber())
        .pipe(pug({
            locals: data
        }).on('error', function(error) {
            console.log(error);
        }))
        .pipe(gulp.dest('dist/'))
    cb();
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Damir Sayahov, 2017-10-19
@vafarulez

The answer here is what and how to optimize.
https://www.youtube.com/watch?v=jocvHauHcA4

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question