gulp-include icon indicating copy to clipboard operation
gulp-include copied to clipboard

support for prepend and append

Open minimit opened this issue 10 years ago • 3 comments

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 argument regex
  • added directive checks
  • with the functions prependString() and appendString() I cached the results, that I add to newText during buffer.

Also I added optional [] on multiple files for this syntax

// @codekit-prepend "path/to/file.js", "path/to/file.js"

minimit avatar Oct 22 '14 21:10 minimit

I don't know how to run the tests. Will look into it if it's needed.

minimit avatar Oct 23 '14 08:10 minimit

This is brilliant. Can we get this committed? This is exactly what I need.

pixelfuture avatar Mar 26 '15 16:03 pixelfuture

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.

KenEucker avatar Apr 06 '19 04:04 KenEucker