Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upNo way to refresh panini cache [v2.0] #143
Comments
This comment has been minimized.
This comment has been minimized.
The In the mean time, you can access the underlying Panini instance and call the const panini = require('panini/gulp');
let paniniInstance;
gulp.task('pages', () => {
const stream = panini('src')
.pipe(gulp.dest('dist'));
paniniInstance = stream._panini;
return stream;
});
gulp.task('pages:refresh', () => {
return paniniInstance.refresh();
}); Make sure |
This comment has been minimized.
This comment has been minimized.
Unfortunately, it gives me But I changed it to this and it works (not correct but at least works):
So, it's fine with partials now, but still not updating translations :( |
This comment has been minimized.
This comment has been minimized.
Ok, I've tested it all again: translations data is never updated. The only way to get partials updated with watch is using |
This comment has been minimized.
This comment has been minimized.
In the task where you run |
This comment has been minimized.
This comment has been minimized.
Yes, I'm. |
This comment has been minimized.
This comment has been minimized.
Alright, thanks for your patience in working through this with me :) I should be able to look into this in the next few days. |
This comment has been minimized.
This comment has been minimized.
illycz
commented
Dec 2, 2017
Any progress? |
This comment has been minimized.
This comment has been minimized.
benland
commented
Jan 16, 2018
If someone found a solution it would be very helpful. @XAMelleOH @illycz . @gakimball thanks for all your work! |
gakimball
referenced this issue
Jan 29, 2018
Closed
What's the equivalent of panini.refresh() in v2.0? #151
Feb 6, 2018
This was referenced
This comment has been minimized.
This comment has been minimized.
Yeah, refresh page is hard. @gakimball i try to use watch(), but no success, they can't find this.panini.options.pages and throw error. |
This comment has been minimized.
This comment has been minimized.
I've been working on file watching over the past week and I've made decent progress. I abstracted some of the more complex dependency management stuff into a small module: https://github.com/gakimball/bistro Hoping to have something for people to use soon! |
This comment has been minimized.
This comment has been minimized.
marvinhuebner
commented
Apr 18, 2018
None of the given solutions (#143 (comment) or #45 (comment)) has worked for me. For now i use panini programmatically inside gulp with a promise: import Panini from 'panini';
function pages() {
return new Promise(resolve => {
const p = new Panini('src', 'dist');
p.build().then(() => {
console.log('Done building');
});
resolve();
});
}
gulp.task('pages', pages); But this is only a workaround, because it creates a new Panini instance in every tasks. In my watch tasks i watch for the files and if they change i call the I've also tried to use
@gakimball i've installed the current https://github.com/zurb/panini/tree/v2.0 branch, maybe this info is useful for you. |
XAMelleOH commentedOct 11, 2017
When I use watch to update files I have the next workaround:
In this case partials updated between watch cycles.
The problem is that
locales
data is not updated.If I use regular way without
.create
then it's vice versa: locales data updated, but partials are not.