blob: 281940226031c80731f8b84a2078f3d48d5b65d4 [file] [log] [blame]
/*eslint-env node */
/*global require: true, module: true */
'use strict';
var options = require('../gulp-options.js'),
gulp = require('gulp'),
// Base dependencies
clean = require('gulp-clean'),
rename = require('gulp-rename'),
// Classical gulp dependencies
uglify = require('gulp-uglify');
var runSequence = require('run-sequence');
gulp.task('minifyvendorjs:clean', function () {
return gulp.src(options.bowerFolderPath + '/**/*.min.js', {read: false})
.pipe(clean());
});
gulp.task('minifyvendorjs:minify', function () {
return gulp
.src(options.bowerFolderPath + '/**/*.js')
.pipe(uglify({
preserveComments: 'false'
}))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest(function(file) {
return file.base;
}))
});
module.exports = function (callback) {
return runSequence(
'minifyvendorjs:clean',
'minifyvendorjs:minify',
callback
);
};