It's possible to use Environment functions in gulp-nunjucks-render? -
i want use nunjucks render, function. example addglobal.
is possible?
the typical other way add variables use nunjucks enviorment's , use addglobal.
gulp nunjucks render built handles it's own environments (as default nunjucks behavior), , stated can pass variables object on render call.
that being said, give ability control own environment looks like. after tinkering able create own environemnt using:
var nunjucksrender = require('gulp-nunjucks-render'); var nunenv = new nunjucksrender.nunjucks.environment([loaders], [opts]);
at point can handle manually per enviroment doc listed above, , use addglobal desire. bit more work though default usage described here, https://github.com/carlosl/gulp-nunjucks-render
Comments
Post a Comment