-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgulpfile.js
55 lines (43 loc) · 1.18 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
var gulp = require('gulp'),
concat = require('gulp-concat'),
connect = require('gulp-connect'),
jspm = require('jspm'),
jshint = require('gulp-jshint'),
karma = require('karma').server;
gulp.task('watch', function() {
var browserSync = require('browser-sync');
browserSync({
online: true,
server: {
baseDir: ['.']
}
});
gulp.watch(['app/**/*.*','tests/**/*.js'], function() {
gulp.run('lint', 'test');
browserSync.reload();
});
});
gulp.task('connect', function() {
connect.server({
root: '',
livereload: false,
port: 9003
});
});
gulp.task('jspm', function() {
return jspm.bundleSFX('app/main', 'dist/build.js', { sourceMaps: true });
});
gulp.task('lint', function() {
return gulp
.src(['gulpfile.js', 'app/**/*.js', 'test/**/*.js'])
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('test', function(done) {
return karma.start({
configFile: __dirname + '/karma.conf.js',
singleRun: true
}, done);
});
gulp.task('build', ['lint','test','jspm']);
gulp.task('default', ['lint','test','watch', 'connect']);