-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
57 lines (48 loc) · 1.31 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
'use strict';
var gulp = require('gulp'),
karma = require('karma').server,
operation = require('./operationalyzer'),
jsufon = require('./jsufonify');
var $ = require('gulp-load-plugins')({
pattern: ['gulp-*']
});
gulp.task('clean-dist', function() {
return gulp.src('dist', { read: false })
.pipe($.rimraf());
});
gulp.task('build', ['copy'], function() {
return gulp.src('src/**/*.coffee')
.pipe($.coffee({bare: true}).on('error', $.util.log))
.pipe(operation())
.pipe($.concat('font.json'))
.pipe(jsufon())
.pipe(gulp.dest('dist/'));
});
gulp.task('build:free', ['copy'], function() {
return gulp.src('src/**/*.coffee')
.pipe($.coffee({bare: true}).on('error', $.util.log))
.pipe(operation())
.pipe($.concat('font_free.json'))
.pipe(jsufon(true))
.pipe(gulp.dest('dist/'));
});
gulp.task('copy', ['clean-dist'], function() {
return gulp.src('src/**/*.js')
.pipe(gulp.dest('dist'));
});
gulp.task('lint', function() {
return gulp.src(['src/**/*.js'])
.pipe($.size())
.pipe($.jshint())
.pipe($.jshint.reporter('jshint-stylish'))
.pipe($.jshint.reporter('fail'));
});
gulp.task('test', ['lint', 'build'], function(done) {
karma.start({
configFile: __dirname + '/karma.conf.js',
singleRun: true
}, done);
});
gulp.task('watch', function() {
gulp.watch(['src/**/*'], ['build']);
});