-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
64 lines (56 loc) · 1.5 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
(function () {
'use strict';
/*jslint node: true */
var gulp = require('gulp'),
concat = require('gulp-concat'),
rename = require('gulp-rename'),
uglify = require('gulp-uglify'),
cssmin = require('gulp-cssmin'),
coveralls = require('gulp-coveralls'),
karma = require('karma').server;
gulp.task('build-js', function () {
return gulp.src('src/**/*.js')
.pipe(concat('n4directives.js'))
.pipe(gulp.dest('dist'))
.pipe(uglify())
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('dist'));
});
gulp.task('build-css', function () {
return gulp.src('src/**/*.css')
.pipe(concat('n4directives.css'))
.pipe(gulp.dest('dist'))
.pipe(cssmin())
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('dist'));
});
gulp.task('build', ['test', 'build-js', 'build-css'], function (done) {
done();
});
gulp.task('test', function (done) {
/*jslint nomen: true */
karma.start({
configFile: __dirname + '/karma.conf.js',
singleRun: true,
browsers: ['PhantomJS']
}, done);
/*jslint nomen: false */
});
gulp.task('test-watch', function (done) {
/*jslint nomen: true */
karma.start({
configFile: __dirname + '/karma.conf.js',
singleRun: false,
browsers: ['PhantomJS']
}, done);
/*jslint nomen: false */
});
gulp.task('coverage', ['test'], function (done) {
gulp.src('coverage/**/lcov.info')
.pipe(coveralls());
});
}());