Matteo Scandolo | a5d03d5 | 2016-07-21 11:35:46 -0700 | [diff] [blame] | 1 | /*eslint-env node */ |
| 2 | (function () { |
| 3 | |
| 4 | 'use strict'; |
| 5 | const gulp = require('gulp'); |
| 6 | const uglify = require('gulp-uglify'); |
| 7 | const concat = require('gulp-concat'); |
| 8 | const wiredep = require('wiredep'); |
| 9 | const del = require('del'); |
| 10 | |
| 11 | module.exports = function(options){ |
| 12 | |
| 13 | gulp.task('cleanVendor', function(){ |
| 14 | return del( |
| 15 | [ |
| 16 | `${options.ngXosVendor}/ngXosVendor.min.js` |
| 17 | ], |
| 18 | {force: true} |
| 19 | ); |
| 20 | }); |
| 21 | |
| 22 | gulp.task('vendor', ['cleanVendor'], function(){ |
| 23 | const bowerDeps = wiredep().js; |
| 24 | return gulp.src(bowerDeps) |
| 25 | .pipe(concat('ngXosVendor.min.js')) |
| 26 | .pipe(uglify()) |
| 27 | .pipe(gulp.dest(options.ngXosVendor)); |
| 28 | }); |
| 29 | }; |
| 30 | })(); |