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

gulp.src as a writable passthrough #548

Closed
corydorning opened this issue Jun 25, 2014 · 2 comments
Closed

gulp.src as a writable passthrough #548

corydorning opened this issue Jun 25, 2014 · 2 comments

Comments

@corydorning
Copy link

I'm trying to pipe some files to a stream per the 3.80 release notes (https://github.com/gulpjs/gulp/blob/master/CHANGELOG.md#380), but i'm not having any luck. My task is as follows:

gullp.task('vendor-js', ['clean'], function() {
    return gulp
      .src(['js/vendor/libs/jquery.min.js', 'js/vendor/libs/jquery-ui.min.js', 'js/vendor/**/*.js'], { cwd: './src/' })

      // minify the js
      .pipe(uglify({ preserveComments: 'some'}))

      // concat all linted/minified js files into app.js
      .pipe(concat('vendor.js', { newLine: '\r\n\r\n' }))

      // add modernizr.js
      .pipe(gulp.src('js/modernizr.min.js'))

      // place vendor.js into /root/dist/js
      .pipe(gulp.dest('./dist/'js/'))
      ;
  });

Which produces this error:

stream.js:94
      throw er; // Unhandled stream error in pipe.
            ^
Error: write after end
    at writeAfterEnd (C:\web\www\gxl-bp\node_modules\gulp\node_modules\vinyl-fs\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:145:12)
    at Transform.Writable.write (C:\web\www\gxl-bp\node_modules\gulp\node_modules\vinyl-fs\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:193:5)
    at Stream.ondata (stream.js:51:26)
    at Stream.emit (events.js:95:17)
    at Stream.endStream (C:\web\www\gxl-bp\node_modules\gulp-concat\index.js:43:10)
    at _end (C:\web\www\gxl-bp\node_modules\gulp-concat\node_modules\through\index.js:65:9)
    at Stream.stream.end (C:\web\www\gxl-bp\node_modules\gulp-concat\node_modules\through\index.js:74:5)
    at Transform.onend (C:\web\www\gxl-bp\node_modules\gulp-uglify\node_modules\through2\node_modules\readable-stream\lib\_stream_readable.js:505:10)
    at Transform.g (events.js:180:16)
    at Transform.emit (events.js:117:20)

If i remove .pipe(gulp.src('js/modernizr.min.js')) all works as expected.

@corydorning
Copy link
Author

Additonally I tried `.pipe(gulp.src('js/modernizr.min.js', { cwd: build.src }))`` with no luck

@yocontra
Copy link
Member

duplicate of gulpjs/vinyl-fs#25

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

2 participants