absolvent / gore-gulp

Simple way to run and maintain React.js projects without any configuration.
MIT License
1 stars 0 forks source link

Plugin pipe injection #27

Open kl3ryk opened 9 years ago

kl3ryk commented 9 years ago

Found this case when tried to use browsersync with gore-gulp. BrowserSync usage:

var reload = browsersync.reload;

gulp.task("sass", function () {
    gulp.src("./scss/**/*.scss")
        .pipe(sourcemaps.init())
        .pipe(sass({
            errLogToConsole: true
        }))
        .pipe(autoprefixer({
            browsers: ["last 4 versions"],
            cascade: false
        }))
        .pipe(minifycss())
        .pipe(sourcemaps.write())
        .pipe(gulp.dest("./css"))
        .pipe(reload({stream: true}));
});

So if we are working on plugin system and we want to use 3 plugins js sass and browsersync there should be possiblity for browsersync to modify task stream in js and sass plugins.

zangrafx commented 9 years ago

I guess it would be more versatile to be able to inject any gulp plugins at the beginning and at the end.

And what about https://christianalfoni.github.io/react-webpack-cookbook/Automatic-browser-refresh instead of BrowserSync?

kl3ryk commented 9 years ago

@zangrafx browsersync is only an example - it could be anything. It is just PoC to show that there should be possibility to inject something into end/beginning of the stream.