foundation / panini

A super simple flat file generator.
Other
592 stars 104 forks source link

panini.refresh crashing when modifying partials #141

Closed j7an closed 7 years ago

j7an commented 7 years ago

My current gulp watch is

gulp.watch([folder.src + 'html/**/*.html'], ['html', reload]);

It seems to only transpile the file in the pages folder requiring another full build to see the entire page. So I changed my gulp.watch to

gulp.watch([folder.src + 'html/**/*.html'], [panini.refresh, 'html', reload]);

But this results in the following crash when modifying partials

/Users/j7an/Documents/exam-prep/node_modules/orchestrator/index.js:89
                                        throw new Error('pass strings or arrays of strings');
                                        ^

Error: pass strings or arrays of strings
    at Gulp.Orchestrator.start (/Users/j7an/Documents/exam-prep/node_modules/orchestrator/index.js:89:12)
    at Gulp.<anonymous> (/Users/j7an/Documents/exam-prep/node_modules/gulp/index.js:36:18)
    at Gaze.<anonymous> (/Users/j7an/Documents/exam-prep/node_modules/glob-watcher/index.js:18:14)
    at emitTwo (events.js:125:13)
    at Gaze.emit (events.js:213:7)
    at Gaze.emit (/Users/j7an/Documents/exam-prep/node_modules/gaze/lib/gaze.js:129:32)
    at /Users/j7an/Documents/exam-prep/node_modules/gaze/lib/gaze.js:415:16
    at StatWatcher._pollers.(anonymous function) (/Users/j7an/Documents/exam-prep/node_modules/gaze/lib/gaze.js:326:7)
    at emitTwo (events.js:125:13)
    at StatWatcher.emit (events.js:213:7)

How do I get the full page transpiled and reloaded via BrowserSync?

j7an commented 7 years ago

Figured it out by looking at this issue here: https://github.com/zurb/panini/issues/62#issue-156313212

Added following

gulp.task('resetPages', (done) => {
  panini.refresh();
  done();
});

Modified watch to following

gulp.watch([folder.src + 'html/{pages,layouts,partials,helpers,data}/**/*.html'], ['resetPages','html', reload]);
gakimball commented 7 years ago

Glad you figured it out! :)