Closed bnjmnt4n closed 8 years ago
Sure, pull request welcome :)
You can see how it's implemented here: https://github.com/sindresorhus/gulp-template/blob/cec7e127bf1acf371c33f1a5beec0f7b3b6e329d/index.js#L21 https://github.com/sindresorhus/gulp-template/blob/cec7e127bf1acf371c33f1a5beec0f7b3b6e329d/test.js#L23-L176
Will work on it and send it in soon ;)
Hmm, appears I read the readme wrongly. I thought this plugin was used to compile Nunjucks templates, didn't realise it was used for precompiling only. I'm not too sure about gulp plugins, should I create another one or just add it as a feature for this plugin?
Add it as a feature. See gulp-template
on how it was done there ;)
What would the API be like? nunjucks
and nunjucks.precompile
like
gulp-template
or something like nunjucks
and nunjucks.compile
to
maintain API consistency?
I would go with nunjucks.compile
and nunjucks.precompile
and preserve nunjucks
for backwards compatibility.
Would be great if you could allow users to specify custom context for Nunjucks through something like gulp-data.