Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

multiple gulp concat - not supported ? #92

Closed
raDiesle opened this issue May 4, 2015 · 2 comments
Closed

multiple gulp concat - not supported ? #92

raDiesle opened this issue May 4, 2015 · 2 comments

Comments

@raDiesle
Copy link

raDiesle commented May 4, 2015

Hi,

using

gulp.src("file.js")
.pipe(concat("file2.js"))
.pipe(concat("file3.js"))
.pipe(gulp.dest("file4.js"));

will not put all files into dest.
Is this expected ?
If true, why does it makes a difference when operating on streams ?

I know using gulp.src(["file.js", "file2.js", "file3.js", "file4.js"]) will fix it.

@yocontra
Copy link
Member

yocontra commented May 4, 2015

What are you expecting to happen here?

@naeramarth7
Copy link

Behaviour of gulp-concat is correct. What your code actually does is renaming file.js to file4.js:

gulp.src("file.js")             // 1
.pipe(concat("file2.js"))       // 2
.pipe(concat("file3.js"))       // 3
.pipe(gulp.dest("file4.js"));   // 4
  1. Put file.js only into the stream
  2. Concat all vinyl files into a single file called file2.js - the only file in the stream is file.js so your actually just renaming it to file2.js
  3. Concat all vinyl files into a single file called file3.js - same as in step 2
  4. Write the vinyl files from stream to a file called file4.js

I know using gulp.src(["file.js", "file2.js", "file3.js", "file4.js"]) will fix it.

This will not just fix it, it is the correct way to use streams and gulp-concat.

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

No branches or pull requests

3 participants