shama / webpack-stream

:tropical_drink: Run webpack through a stream interface
MIT License
1.39k stars 122 forks source link

Cannot get on('end') with webpack watch mode enabled. #189

Open redplane opened 6 years ago

redplane commented 6 years ago

Hi,

I'm using webpack-stream version 4.0.3 with gulp.

This is my gulp task:

         gulp.src(szEntryFile)
                .pipe(webpackStream(oWebpackOption, webpack))
                .on('end', () => {
                    console.log('Finish');
                })
                .pipe(gulp.dest(paths.dist));

This is my webpack.config.js file:

{
   ...,
   watch: true,
        watchOptions: {
            poll: false
        }
}

When I ran the gulp task above, web pack ran successfully but there was no 'Finish' message.

Can anyone help me please ?

Thanks,

linuxonrails commented 6 years ago

Same problem :-(

onelongblock commented 6 years ago

Same

javipuche commented 5 years ago

Same

stoplion commented 5 years ago

+1

Backfighter commented 4 years ago

Looking at the source code you can see that: Webpack-stream acts as an endless stream if you set it into watch mode. Files will be continuously piped out on every rebuild. If you want to know when a rebuild finished you should use the callback as documented in the README.