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文件夹:
生成的目标文件夹: