-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No way to refresh panini cache [v2.0] #143
Comments
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 |
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 :( |
Ok, I've tested it all again: translations data is never updated. The only way to get partials updated with watch is using |
In the task where you run |
Yes, I'm. |
Alright, thanks for your patience in working through this with me :) I should be able to look into this in the next few days. |
Any progress? |
If someone found a solution it would be very helpful. @XAMelleOH @illycz . @gakimball thanks for all your work! |
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. |
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! |
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. |
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.The text was updated successfully, but these errors were encountered: