Git Product home page Git Product logo

Comments (5)

dashed avatar dashed commented on August 16, 2024

@erikras I think gulp uses object mode since each element in the stream is a vinyl object: https://github.com/wearefractal/vinyl

You'll have better luck posting to gulp issues forum.

from through2.

laurelnaiad avatar laurelnaiad commented on August 16, 2024

For streams of files, gulp uses objectMode. Are you referring to a particular gulp plugin that is not using objectMode? Or are you referring to a stream of the file contents? If it's a stream of the file contents, I think you're on your own...

from through2.

erikras avatar erikras commented on August 16, 2024

The problem is that exorcist is not an official gulp plugin, and apparently I don't understand node streams well enough to wrap it into a gulp plugin. Exorcist takes command line piped input. It sounds like I'd have to unwrap the vinyl object, pass it through exorcist, and then wrap it again. It seems like a common enough problem that I thought maybe someone had written one.

Thanks for your quick replies.

from through2.

erikras avatar erikras commented on August 16, 2024

Aha!!! I knew this was possible. vinyl-transform to the rescue!

from through2.

erikras avatar erikras commented on August 16, 2024

For posterity, this is how you wrap exorcist for gulp:

'use strict';
var gulp = require('gulp'),
  browserify = require('gulp-browserify'),
  transform = require('vinyl-transform'),
  exorcist = require('exorcist'),
  concat = require('gulp-concat');

gulp.task('browserify', function () {
  gulp
    .src('src/app.js')
    .pipe(browserify({
      debug: true
    }))
    .pipe(transform(function () {
      return exorcist('dist/script.map');
    }))
    .pipe(concat('script.js'))
    .pipe(gulp.dest('./dist'));
});

gulp.task('default', ['browserify']);

from through2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.