Not changing .hbs files triggering nodemon restarts


Not changing .hbs files triggering nodemon restarts



I use handlebars and nodemon on Windows. I've noticed (when using the debug argument for nodemon), hbs files - even when they aren't being edited - trigger a nodemon change.


debug



Are the files actually changing? Why are they changing if I'm not editing them?


[11:22:46] [nodemon] files triggering change check: ..forgot-sent.hbs
[11:22:46] [nodemon] matched rule: C:UsersmeDocumentsmyappviews/**/*
[11:22:46] [nodemon] changes after filters (before/after): 1/1
[11:22:46] [nodemon] restarting due to changes...
[11:22:46] [nodemon] viewsforgot-sent.hbs



How can I make nodemon refresh when files are changed, and not refresh when files are not changed?



Edit: looks like a bug on nodemon/Windows, see https://github.com/remy/nodemon/issues/1208





Try running with nodemon -L
– souravlahoti
Apr 24 at 10:43


nodemon -L





Thanks @beingsrv! Alas I've done some research and found a bunch of other Windows users having the same problem - opens causing nodemon to restart - I've added a link to the bug above.
– mikemaccana
Apr 24 at 11:17




1 Answer
1



add filenames extension after command nodemon as...


nodemon



nodemon -e 'js|handlebars|hbs|html'


nodemon -e 'js|handlebars|hbs|html'



-e specifies extensions to be tracked



You can add different filetypes if you use other template engines as 'js|ejs|hbs'.


'js|ejs|hbs'






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

api-platform.com Unable to generate an IRI for the item of type

How to set up datasource with Spring for HikariCP?

Display dokan vendor name on Woocommerce single product pages