shama / webpack-stream

:tropical_drink: Run webpack through a stream interface
MIT License
1.4k stars 123 forks source link

`pipe(gulp(dest))` actually works? #217

Closed stoplion closed 4 years ago

stoplion commented 5 years ago

Unless I'm misunderstanding, when running...

gulp.task('default', function() {
  return gulp.src('src/entry.js')
    .pipe(webpack())
    .pipe(gulp.dest('foobar/'));
});

a javascript file will never make to the dir foobar.

It just drops it in the dist, regardless of what gulp.dest you set.

Is this correct?

The destination is actually set in the webpack config and never the pipe(gulp(dest)) ?

robchristian commented 5 years ago

+1 on this. Not holding my breath about getting a response. Been almost 5 months and there's no reply to this issue.

Backfighter commented 5 years ago

Looking at the source code suggested that using dest() should actually work. Webpack-stream uses a virtual filesystem for webpack, so unless you pipe the output into dest it will not write any files to disk at all.

navanshu commented 4 years ago

Pass configs to your build maybe like this. The output directive is important.

.pipe(webpack({
        mode: "production",
        output: {
            filename: 'lazysizes.js',
          },
    }))