gulp之webpack-stream模块

webpack-stream功能:打包文件

gulpfile.js:

var gulp = require('gulp');
var webpack = require('webpack-stream');
gulp.task('webpackTask',function(){
  var obj = {
    entry:{
      main123:"E:/NodeLearn/gulp_20170918_webpack-stream/src/main.js"
    },
    output:{
      filename:'[name].js'
    }
  }
  return gulp.src([])
    .pipe(webpack(obj))
    .pipe(gulp.dest('build/'));
})

效果:

src文件夹:

 

生成的目标文件夹:

 

posted on 2017-09-19 16:32  王雪皓  阅读(1222)  评论(0编辑  收藏  举报