-
-
Notifications
You must be signed in to change notification settings - Fork 240
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
Support for Node.js file resolve based on require.resolve #168
Comments
It seems the root option is not enough to cover this situation. Maybe we need another option for this, or it can be implemented as a fallback when no templates found in root directories, in which case it'll be backward-compatible and the additional option is not needed. Another concern is Feel free to file a PR if you're already digging into it, I can help with the test cases and doc. |
# [9.3.0](v9.2.0...v9.3.0) (2019-11-07) ### Features * support require.resolve for lookup, see [#168](#168) ([2dd4355](2dd4355))
Now it's implemented as a fallback so if no matching template is found under |
Awesome, thank you! 🙌 Sorry I didn't respond earlier — got suddenly swamped this week. I think it was a good call to do it after an attempted local search too! That was going to be my main suggestion. |
Hello! 👋
I was wondering if you'd consider support (either via a flag, or something else!) for allowing file resolution on the Node.js side to be optionally based on
require.resolve
. What this would enable is the ability to provide paths to the{% layout %}
and{% include %}
tags that are able to find templates that may have been installed vianpm
. What's kind of cool about that is that you can maintain a separate project just for templates and such that could easily be imported into a project. Earlier this year Nunjucks added similar functionality.I do think this could be accomplished easily enough by providing a custom
fs
implementation, but it's unfortunate that a user would be required to essentially copy all of the existing Node implementation only to alter theresolve
function.If there are any other easier paths I may be overlooking, please let me know! I've been using Nunjucks for a while but increasingly keep coming back to Liquid JS and this is one of the few features I'd miss out on.
Thank you!
The text was updated successfully, but these errors were encountered: