-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathgulpfile.js
61 lines (51 loc) · 1.53 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
// plugins
var debug = require('gulp-debug');
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var ngAnnotate = require('gulp-ng-annotate');
var rename = require("gulp-rename");
var uglify = require('gulp-uglify');
var gulpProtractorAngular = require('gulp-angular-protractor');
var dist = 'dist/';
var examples = 'examples/';
var js = '*.js';
var app = dist + 'angular-eonasdan-datetimepicker.js';
var minApp = 'angular-eonasdan-datetimepicker.min.js';
// tasks
gulp.task('lint-dev', function () {
return gulp.src([app, examples + js])
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('lint-dist', function () {
return gulp.src([app, examples + js])
.pipe(jshint())
.pipe(jshint.reporter('default'))
.pipe(jshint.reporter('fail'));
});
gulp.task('minify', function () {
return gulp.src(app)
.pipe(ngAnnotate())
.pipe(uglify())
.pipe(rename(minApp))
.pipe(gulp.dest(dist));
});
// main tasks
gulp.task('dist', ['lint-dist', 'minify'], function () {
});
gulp.task('dev', ['lint-dev', 'minify'], function () {
gulp.watch([app], ['lint', 'minify']);
});
// testing
gulp.task('protractor', ['dist'], function () {
return gulp.src('tests/*.js')
.pipe(gulpProtractorAngular({
'configFile': 'protractor.conf.js',
'debug': false,
'autoStartStopServer': true,
'verbose': false,
'webDriverUpdate': {
'browsers': ['ie', 'chrome']
}
}));
});