This repository has been archived by the owner on May 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
gulpfile.js
52 lines (50 loc) · 1.61 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
// Include gulp
var gulp = require('gulp');
// Include Our Plugins
var jshint = require('gulp-jshint');
var Server = require('karma').Server;
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var ngAnnotate = require('gulp-ng-annotate');
// Lint Task
gulp.task('lint', function() {
return gulp.src('src/*/*.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
// Concatenate & Minify JS
gulp.task('scripts', function() {
return gulp.src([
'src/directives/cytoscape-directive.js',
'src/directives/graph-elements.js',
'src/directives/graph-layout.js',
'src/directives/graph-style.js',
'src/directives/graph-extensions.js',
'src/services/cytoCreateGraph.js',
'src/services/cytoElementsHelpers.js',
'src/services/cytoData.js',
'src/services/cytoEvents.js',
'src/services/cytoGraphDefaults.js',
'src/services/cytoHelpers.js',
'src/services/cytoLayoutDefaults.js'
])
.pipe(concat('ngCytoscape.js'))
.pipe(gulp.dest('dist'))
.pipe(rename('ngCytoscape.min.js'))
.pipe(uglify())
.pipe(gulp.dest('dist'));
});
gulp.task('test', function (done) {
new Server({
configFile: __dirname + '/karma.conf.js',
singleRun: true
}, done).start();
});
// Watch Files For Changes
gulp.task('watch', function() {
gulp.watch(['src/services/*.js', 'src/directives/*.js'], ['lint', 'scripts']);
});
gulp.task('build', ['lint','test','scripts']);
// Default Task
gulp.task('dev', ['lint', 'scripts', 'watch']);