-
Notifications
You must be signed in to change notification settings - Fork 78
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
Large HB project, seems to write to JSON file over and over even with no changes #118
Comments
I'm not sure what you mean. I think devMode is supposed to prevent writing files and might help you |
I am using livereload to reload the pages I'm working on when they change. However, every time HBS generates pages, i18n-node-2 writes to the language file, even if I've not changed any text/added any keys This leads to a loop whereby the two watchers are triggering each other. For the time being I've added dump: function () {
throw ('error');
} into the options passed in on instantiation which forces it to throw an error before it tries to write to the file, this works but fills my debug log with error messages... devMode would work but unfortunately it caches the JSON meaning the page doesn't get updates when I add keys to the JSON. Is there an option to disable the cache? |
Hm, I'm not sure if there is a solution to this and I don't have a lot of time to investigate myself. If you ever find a solution, don't hesitate to discuss / PR. |
I can certainly create a PR with a "preventWrite" option or something - if you'd like me to I'll do this, just let me know your preferred name for this option... |
|
Hello, Thanks. |
I have a project set up with a watcher to regenerate templates on language file change - but the action of running the template generation sends the thing into a loop as it detects changes to the i18n json file and runs over and over again, even when there are no new keys added.
Is there a way to
a) simply prevent updating of the json file? I'm happy adding my own keys or
b) making the module only create a new json file on change?
The text was updated successfully, but these errors were encountered: