-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.js
48 lines (43 loc) · 1.35 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
concat = require('gulp-concat'),
size = require('gulp-size'),
header = require('gulp-header'),
qunit = require('gulp-qunit');
gulp.task('compile', function() {
var heading = '/* (c) Diego Cardozo - license: https://github.com/diegocard/dry.js/blob/master/LICENSE */\n';
gulp.src([
'./src/Core.js',
'./src/Settings.js',
'./src/Utilities.js',
'./src/Dom.js',
'./src/App.js',
'./src/Router.js',
'./src/Model.js',
'./src/Filter.js',
'./src/Controller.js',
'./src/Template.js',
'./src/View.js',
'./node_modules/d.js/lib/D.min.js',
'./src/Promise.js',
])
.pipe(concat('dry.js'))
.pipe(header(heading))
.pipe(gulp.dest('dist'))
.pipe(size({title: 'Unminified'}))
.pipe(uglify())
.pipe(header(heading))
.pipe(rename('dry.min.js'))
.pipe(gulp.dest('dist'))
.pipe(size({title: 'Minified'}))
.pipe(size({title: 'Minified and gzipped', gzip: true}));
});
gulp.task('watch', function() {
return gulp.watch('src/*.js', ['default']);
});
gulp.task('test', function() {
return gulp.src('./test/UnitTests.html')
.pipe(qunit());
});
gulp.task('default', ['compile']);