gulp-include
gulp-include copied to clipboard
support for prepend and append
with
// @codekit-prepend path/to/file.js
// @codekit-append path/to/file.js
As I explained it's the syntax this 'precompiler' sofwares use. https://github.com/wiledal/gulp-include/issues/30
The lines added are very simple, I just:
- added one regex for prepend and one regex for append (you should be able to add your own if you want)
- executed
expand()
with the new argumentregex
- added directive checks
- with the functions
prependString()
andappendString()
I cached the results, that I add tonewText
during buffer.
Also I added optional []
on multiple files for this syntax
// @codekit-prepend "path/to/file.js", "path/to/file.js"
I don't know how to run the tests. Will look into it if it's needed.
This is brilliant. Can we get this committed? This is exactly what I need.
All that this pull request needs now is some tests created around the use cases for this feature. I will circle back to this item after we get through the more critical PRs and resolve the conflicts if I need to.