I am new to creating a gulpfile.js
manually for my project based on Backbone and Marionette. My initial gulp file had the following structure:
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var browserify = require('browserify');
var del = require('del');
var watchify = require('watchify');
var source = require('vinyl-source-stream');
var stylish = require('jshint-stylish');
var buffer = require('vinyl-buffer');
var _ = require('lodash');
// More tasks defined here...
gulp.task('default', ['watch']);
Recently, I decided to add JavaScript minification using uglify-js-harmony. Since most of my code is in ES6, this was necessary for compatibility reasons. Here's how I modified my gulpfile:
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var browserify = require('browserify');
var del = require('del');
var watchify = require('watchify');
var source = require('vinyl-source-stream');
var stylish = require('jshint-stylish');
var buffer = require('vinyl-buffer');
var uglifyjs = require('uglify-js-harmony');
var minifier = require('gulp-uglify/minifier');
var pump = require('pump');
var _ = require('lodash');
// Remaining tasks continue...
After adding the compression task, my gulp build
seems to run indefinitely without any errors and the generated files are not minified as expected. Is there something wrong with how I've integrated the compression task or should it be part of the bundling process? Any guidance on this issue would be greatly appreciated.