Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.