The webpage "plugins" for gulp state, "No need for a gulp plugin. Just use webpack directly." but your examples don't just use WebPack directly, they miss out on the point of Gulp entirely.
For example, this is how I use Browserify:
gulp.src('./scripts/index.js', {read: false})
.pipe(browserify({
insertGlobals: false,
debug: true,
transform: ['uglifyify'],
'global-transform': true
}))
.pipe(rename('speech.js'))
.pipe(gulp.dest('./spx/meta/'));
This is how I setup Google Closure:
gulp.src('./babel/babel.js')
.pipe(closure({compilation_level: 'ADVANCED_OPTIMIZATIONS'}))
.pipe(rename('babel.mini.js'))
.pipe(gulp.dest(location));
gulp.src('./babel/babel.js')
.pipe(closure({compilation_level: 'ADVANCED_OPTIMIZATIONS'}))
.pipe(zip())
.pipe(rename('babel.mini.js.gz'))
.pipe(gulp.dest(location));
Here is how I am supposed to use Web Pack with Gulp:
gulp.task("webpack", function(callback) {
// run webpack
webpack({
// configuration
}, function(err, stats) {
if(err) throw new gutil.PluginError("webpack", err);
gutil.log("[webpack]", stats.toString({
// output options
}));
callback();
});
});
The // configuration shows that you are missing the point of Gulp: code over configuration. If you are asking me to write a bunch of foreign config then you obviously "need a plugin" because I don't want to "use Web Pack directly". I want to pass it files using a pipe and I want to direct the output to files but your examples don't tell me how to do that.
If I just wanted a task runner, I could use Grunt or WebPack directly. I choose Gulp because it makes it easier for me to iteratively build up a large number of tasks.
The webpage "plugins" for gulp state, "No need for a gulp plugin. Just use webpack directly." but your examples don't just use WebPack directly, they miss out on the point of Gulp entirely.
For example, this is how I use Browserify:
This is how I setup Google Closure:
Here is how I am supposed to use Web Pack with Gulp:
The
// configurationshows that you are missing the point of Gulp: code over configuration. If you are asking me to write a bunch of foreign config then you obviously "need a plugin" because I don't want to "use Web Pack directly". I want to pass it files using a pipe and I want to direct the output to files but your examples don't tell me how to do that.If I just wanted a task runner, I could use Grunt or WebPack directly. I choose Gulp because it makes it easier for me to iteratively build up a large number of tasks.