Closed w-biggs closed 5 years ago
panini.refresh()
is definitely what you're looking for. It reloads the internal cache of layouts/pages/partials/helpers.
The Foundation ZURB Template has an example of it in action.
There's a task:
function resetPages(done) {
panini.refresh();
done();
}
And then a set of watchers that run the above task, and a page compiling task in sequence:
gulp.watch('src/{layouts,partials}/**/*.html').on('all', gulp.series(resetPages, pages, browser.reload));
gulp.watch('src/data/**/*.{js,json,yml}').on('all', gulp.series(resetPages, pages, browser.reload));
gulp.watch('src/helpers/**/*.js').on('all', gulp.series(resetPages, pages, browser.reload));
Let me know if this helps!
That worked perfectly. Not sure what I was doing before that caused that to not work... thanks!!
Hey all. I'm using Panini alongside BrowserSync and am having an issue. When I update partials or layouts, running Panini is not applying those updates to the outputted files; however, when I then update the page file, those partials and layouts all suddenly update. I'm not sure why this is; I've messed around with
panini.refresh
but I'm not sure that's what I'm looking for. Here's my gulpfile:Thanks all.