-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
48 lines (43 loc) · 1.1 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
'use strict';
/*global require*/
var gulp = require('gulp'),
rename = require('gulp-rename'),
notify = require('gulp-notify'),
uglify = require('gulp-uglify'),
transpile = require('gulp-babel'),
jshint = require('gulp-jshint'),
karma = require('karma');
gulp.task('build', function() {
return gulp.src('multilang.js').pipe(
jshint()
).pipe(
jshint.reporter('default', { verbose: true})
).pipe(
jshint.reporter('fail')
).pipe(
transpile({presets: ['es2015']})
).pipe(
uglify()
).pipe(
rename({suffix: '.min'})
).pipe(
gulp.dest('dist/')
).pipe(
notify({ message: 'Build task complete' })
);
});
gulp.task('travis_test', function (done) {
new karma.Server({
configFile: __dirname + '/test/karma.conf.js',
browsers: ['Firefox'],
preprocessors: {
'multilang.js': ['coverage', 'babel']
},
babelPreprocessor: {
options: {
presets: ['es2015']
}
},
singleRun: true
}, done).start();
});