You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Helpers like partials are a nearly ubiquitous concept among tempting engines. Just like partials it would be nice to be able to express a path in the view config:
Typically, each helper is in a file, rather than all helpers in one file. So, any configuration would have to accept a directory or a file with or without the js. So:
helpersPath = __dirname + '/templates/helpers' will load foo.js && bar.js and helpersPath = __dirname + '/templates/helpers/foo' or ...foo.js should just load foo.js.
The 2nd part that makes this tricky is that although nearly all tmpl engines have helpers, they are declared in a slightly different way. And, I'm not sure Consolidate provides a standard interface.
The 3rd part (that makes this a lame request) Using fs to load files is a bit slow. Applications with a glut of helpers will start slowly. Furthermore, Hapi.createServer(...).start() should not be called until all helpers have loaded.
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.
lockbot
locked as resolved and limited conversation to collaborators
Jan 9, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Helpers like partials are a nearly ubiquitous concept among tempting engines. Just like partials it would be nice to be able to express a path in the view config:
Currently I achieve the desired functionality by:
With the config:
views.engine.module = handelbars
.And the helpers following the form:
The text was updated successfully, but these errors were encountered: