Problem with loaders

34 views
Skip to first unread message

Andrey Petrov

unread,
Feb 13, 2014, 8:05:48 PM2/13/14
to nunj...@googlegroups.com
Hello.
I have problem with loaders.
If i replace web loader with my own loader, precompiled templates are not available.
Usage of precompiled templates does not mean than I want to use web loader.
For example, i can have my templates in <script> tag on the page, not somewhere in the web, but in the same time I want to use some templates in precompiled way.
If u will make separate loaders for precompiled templates and for web loading, it will be possible to use precompiled templates loader with my own loaders together.

Here's the code that i use in my project: https://gist.github.com/sunflowerdeath/8987859

Also I added to my loaders method exists() that let me check existance of templates. And I extended Environments prototype with same method, that checks all its loaders.

jlongster

unread,
Feb 24, 2014, 4:49:56 PM2/24/14
to nunj...@googlegroups.com
For reference sake, we've been discussing this in the following bugs:

https://github.com/jlongster/nunjucks/issues/195
https://github.com/jlongster/nunjucks/issues/194
Reply all
Reply to author
Forward
0 new messages