Using webpack 2 from gulp (webpack-stream for webpack 2)?

橙三吉。 提交于 2019-11-30 08:26:26

You need to have both webpack and webpack-stream installed:

npm install --save-dev webpack-stream
npm install --save-dev webpack@2.1.0-beta.25

Then you can pass the webpack object as the second parameter to webpack-stream:

var gulp = require('gulp');
var webpackStream = require('webpack-stream');
var webpack2 = require('webpack');

gulp.task('default', function() {
  return gulp.src('src/entry.js')
    .pipe(webpackStream({/* options */}, webpack2))
    .pipe(gulp.dest('dist/'));
});
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!