-
Notifications
You must be signed in to change notification settings - Fork 33
/
gulpfile.js
57 lines (51 loc) · 1.17 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
var gulp = require('gulp');
var concat = require('gulp-concat');
var coffee = require('gulp-coffee');
var karma = require('karma').server;
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var browserSync = require('browser-sync');
var karmaConf = {
browsers: ['PhantomJS'],
//browsers: ['Chrome'],
preprocessors: {
'**/*.coffee': ['coffee'],
},
frameworks: ['jasmine'],
coffeePreprocessor: {
// options passed to the coffee compiler
options: {
bare: true,
sourceMap: true
},
// transforming the filenames
transformPath: function(path) {
return path.replace(/\.coffee$/, '.js');
}
},
files: [
'gh/*.js',
'spec/*.coffee'
]
};
var sourceGlob = [
'source/*.coffee'
];
gulp.task('browser-sync', function() {
browserSync.init(null, {
server: {
baseDir: './'
}
});
});
gulp.task('watch', ['browser-sync'], function(done) {
karma.start(karmaConf, done);
gulp.watch(sourceGlob, ['gh']);
});
gulp.task('gh', function() {
return gulp.src(sourceGlob)
.pipe(coffee())
.pipe(concat('svg-input-elements.js'))
.pipe(gulp.dest('gh/'));
});
gulp.task('default', ['watch']);