Open d-simon opened 8 years ago
I notice you're working off a significantly outdated version of twig.js
. Was there a reason you chose backflip's fork? At the time of his work, the only difference was a small change to ID validation. Have you tried using gulp-twig
with the latest twig.js
, for example via
https://github.com/olets/gulp-twig#update-dependencies
? (see also #32)
I needed this to prepend an include when generating the styleguide over here. For this I integrated inline includes as implemented in a different gulp-twig implementation.
A noteworthy change is line 78 in index.js. Instead of passing a file path, the plugin now passes the
file.contents
as string to Twig. This was necessary for my use case. Is there any downside to this?Secondly, I introduced three dependenies (lodash.merge, lodash.isarray and glob).
And lastly, I have not written any tests for this. Though the current ones are passing.
What are your thoughts on this? :-)
Important: Not ready to merge! To make this work, I had to disable the cache of Twig, which has a very subtle bug with the id of templates (I will open a PR and cross-reference it here). => Before anything the bugfix will first have to be approved and make it into a release of Twig.js.