admin管理员组

文章数量:1323731

Considering the following Webpack Gulp task, how can this be integrated with Gulp in such a way that after piling Webpack pipes the files to Gulp so that I can run further tasks?

gulp.task('webpack', function(callback) {
  webpackCompiler.run(function(err, stats) {
    if (err) {
      throw new plugins.util.PluginError('webpack', err);
    }
    plugins.util.log('webpack', stats.toString({
      colors: true,
    }));
    callback();
  });
});

gulp.task('set-env-dev', function() {
  webpackConfig.plugins = [
    new webpack.BannerPlugin(info.name + '\n' + info.version + ':' + Date.now() + ' [development build]'),
    new ComponentPlugin()
  ];
  webpackCompiler = webpack( webpackConfig );
});

Considering the following Webpack Gulp task, how can this be integrated with Gulp in such a way that after piling Webpack pipes the files to Gulp so that I can run further tasks?

gulp.task('webpack', function(callback) {
  webpackCompiler.run(function(err, stats) {
    if (err) {
      throw new plugins.util.PluginError('webpack', err);
    }
    plugins.util.log('webpack', stats.toString({
      colors: true,
    }));
    callback();
  });
});

gulp.task('set-env-dev', function() {
  webpackConfig.plugins = [
    new webpack.BannerPlugin(info.name + '\n' + info.version + ':' + Date.now() + ' [development build]'),
    new ComponentPlugin()
  ];
  webpackCompiler = webpack( webpackConfig );
});
Share Improve this question asked Jun 20, 2014 at 8:21 Luis MartinsLuis Martins 1,4812 gold badges18 silver badges33 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

There is now a plugin for Gulp that allows deeper integration of Webpack and Gulp: https://github./shama/webpack-stream

本文标签: javascriptHow to pass Webpack generated files to Gulp streamsStack Overflow