-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.js
31 lines (25 loc) · 999 Bytes
/
Gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
var gulp = require('gulp');
var header = require('gulp-header');
var rename = require('gulp-rename');
var rimraf = require('gulp-rimraf');
var uglify = require('gulp-uglify');
var util = require('gulp-util');
var pkg = require('./package.json');
var currentYear = util.date(new Date(), 'yyyy');
var banner = '/*! <%= pkg.name %> v<%= pkg.version %> | Copyright (c) 2013-<%= currentYear %> <%= pkg.author %> | <%= pkg.license %> license | <%= pkg.homepage %> */\n';
gulp.task('scripts', function() {
return gulp.src('./lare.js')
.pipe(uglify())
.pipe(header(banner, {pkg: pkg, currentYear: currentYear}))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('.'));
});
gulp.task('clean', function() {
return gulp.src('./lare.min.js', {read: false})
.pipe(rimraf({force: true}));
});
gulp.task('prepare-tests', function() {
return gulp.src('./lare.js')
.pipe(gulp.dest('./test_app/static/'))
});
gulp.task('default', ['clean', 'scripts']);