Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Ordering concatenations #37

Closed
ELLIOTTCABLE opened this issue May 24, 2014 · 1 comment
Closed

Ordering concatenations #37

ELLIOTTCABLE opened this issue May 24, 2014 · 1 comment

Comments

@ELLIOTTCABLE
Copy link

I know this has been brought up before, having looked through the issues; but I have a new use-case here, and thought it might deserve another look:

When I need to add more files further into a stream, I don't have an option about their position in the stream's list of files. For instance, when acquiring a set of files, preforming some operation on those, and then acquiring other files I don't want to preform that operation on … now, I'm stuck with gulp-concat putting whatever files I don't process, last.

Specific example:

gulp.task 'build-css', ->
   return gulp
      .src [ './Resources/*.less' ]
      .pipe plugin('if') /[.]less$/, plugin('less') paths: './Resources'
      .pipe plugin('myth')()
      .pipe plugin('minify-css') keepBreaks: yes
      .pipe gulp.src './bower_components/normalize.css/normalize.css'
      .pipe plugin('concat')()
      .pipe gulp.dest './Resources'

There's no way of doing this without either A) some complex backflips to manipulate the streams themselves, or B) ending up with the contents of normalize.css at the end of my concatenated CSS file.

So, my thought: if you accept #36; it will become possible to deterministically order streams by reversing, concatenating, and then re-reversing. Or something like that. Doesn't seem great, but I can't think of any easier ways to do this. /=

@yocontra
Copy link
Member

https://www.npmjs.org/package/gulp-add-src if you want to add files into a stream

We will have something for this in gulp 4, there is an issue for that as well so check the milestone on the main repo.

As for ordering of streams, there are tons of libraries for this already - search npm

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants