mozilla / nunjucks

A powerful templating engine with inheritance, asynchronous control, and more (jinja2 inspired)

Home Page:https://mozilla.github.io/nunjucks/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot create multiple instances each having its own configuration

mustafaekim opened this issue · comments

Hi, is there a way to create multiple instance of nunjucks template engine so that we can have different configurations for each instance?

Thanks, however it seems like it does not work as expected. Below, I added the first line as per the documentation and commented out the second line, but I am getting the below error.

(node:35524) UnhandledPromiseRejectionWarning: Error: Cannot find module 'njk'

var nunjucksEnv = new LX.nunjucks.Environment(new LX.nunjucks.FileSystemLoader('views'), nunjucksConfig);
//LX.nunjucks.configure('views', nunjucksConfig)

Do you have any idea how to make it work?

PS: LX simply exports the nunjucks from npm.