-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathgulpfile.js
48 lines (37 loc) · 1.14 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
'use strict';
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var karma = require('karma').server;
gulp.task('scripts', function () {
return gulp.src('src/**/*.coffee')
.pipe($.coffeelint())
.pipe($.coffeelint.reporter())
.pipe($.coffee())
.pipe(gulp.dest('dist'));
});
gulp.task('minify', ['scripts'], function () {
gulp.src('dist/ng-country-select.js')
.pipe($.uglify())
.pipe($.concat('ng-country-select.min.js'))
.pipe(gulp.dest('dist'))
});
gulp.task('clean', require('del').bind(null, ['.tmp', 'dist']));
gulp.task('test', function (done) {
karma.start({
configFile: __dirname + '/test/karma.conf.coffee',
singleRun: true
}, done);
});
gulp.task('tdd', function (done) {
karma.start({
configFile: __dirname + '/test/karma.conf.coffee',
reporters: ['progress', 'osx', 'clear-screen']
}, done);
});
gulp.task('watch', [], function () {
gulp.watch(["src/**/*.coffee"], ["minify", "test"]);
});
gulp.task('build', ['scripts', 'minify', 'test']);
gulp.task('default', ['clean'], function () {
gulp.start('build');
});