gulp.task("webpack", function (callback) { // run webpack webpack(webpackConfig, function (err, stats) { if (err) throw new gutil.PluginError("webpack", err); gutil.log("[webpack]", stats.toString({ // output options })); callback(); }); });
gulp.task('clean', function(callback) { del([config.dirs.dist + '*', config.dirs.server + '*']) .then(function() { callback(); }); });
gulp.task("build", function(callback) { // run webpack webpack( // configuration require('./webpack.config.js'), function(err, stats) { if(err) throw new gutil.PluginError("webpack", err); gutil.log("[webpack]", stats.toString({ // output options })); callback(); }); });
gulp.task("webpack:build", function(callback) { // modify some webpack config options var myConfig = Object.create(webpackConfig); myConfig.plugins = myConfig.plugins.concat( new webpack.DefinePlugin({ "process.env": { "NODE_ENV": JSON.stringify("production") } }), new webpack.optimize.DedupePlugin(), new webpack.optimize.UglifyJsPlugin() ); // run webpack webpack(myConfig, function(err, stats) { if(err) throw new gutil.PluginError("webpack:build", err); gutil.log("[webpack:build]", stats.toString({ colors: true })); callback(); }); });
gulp.task('build:watch:app', (callback) => { compiler.watch({ aggregateTimeout: 300 }, function(err, stats) { if(err) { gutil.log('error', new gutil.PluginError('[webpack]', err)); } printReport(stats); }); callback(); });
gulp.task("webpack:build-dev", function(callback) { // run webpack devCompiler.run(function(err, stats) { if(err) throw new gutil.PluginError("webpack:build-dev", err); gutil.log("[webpack:build-dev]", stats.toString({ colors: true })); callback(); }); });
gulp.task('build:app', (callback) => { compiler.run(function(err, stats) { if(err) { gutil.log('error', new gutil.PluginError('[webpack]', err)); } printReport(stats); callback(); }); });
// rename the following task to bundle to stop using fuse-box and use webpack instead gulp.task("webpack", function(callback) { // run webpack webpack(require('./config/webpack.config.js'), function(err, stats) { if(err) throw new gutil.PluginError("webpack", err); gutil.log("[webpack]", stats.toString({ // output options })); callback(); }); });
gulp.task('webpack', function (callback) { webpack(webpackConfig, function (err, stats) { if (err) { throw new gutil.PluginError('webpack', err); } gutil.log('[webpack]', stats.toString({ modules: false, colors: true })); callback(); }); });
// webpack tasks gulp.task('webpack', function (callback) { webpack(webpackConfig, (err, stats) => { if (err) throw new gutil.PluginError('webpack', err); gutil.log('[webpack]', stats.toString({ // error output options })); callback(); }); });
gulp.task("webpack", function (callback) { // run webpack webpack(webpackConfig, function (err, stats) { if (err) throw new gutil.PluginError("webpack", err); gutil.log("[webpack]", stats.toString({ // output options })); callback(); }); });