UNPKG

easybrowser

Version:

Detect browser and implement helpful classes.

47 lines (43 loc) 1.02 kB
var gulp = require('gulp'); var gp_concat = require('gulp-concat'); var beautify = require('gulp-beautify'); var minify = require('gulp-minify'); var umd = require('gulp-umd'); gulp.task('umd', function() { return gulp.src('./src/core/*.js') .pipe(umd({ dependencies: function(file) { return [ { name: 'lend' }, { name: 'occurrence' } ]; }, exports: function(file) { return 'easyBrowser'; }, namespace: function(file) { return 'easyBrowser'; } })) .pipe(beautify({indentSize: 4})) .pipe(gulp.dest('build')); }); gulp.task('minify', ['umd'], function() { gulp.src('./build/easyBrowser.js') .pipe(minify({ ext:{ src:'.js', min:'-min.js' }, exclude: ['tasks'], output: { comments: /^!|@preserve|@license|@cc_on/i } })) .pipe(gulp.dest('./')) }); gulp.task('default', ['minify', 'umd']);