-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
35 lines (30 loc) · 945 Bytes
/
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
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var mocha = require('gulp-mocha');
var streamify = require('gulp-streamify');
var uglify = require('gulp-uglify');
var source = require('vinyl-source-stream');
var browserify = require('browserify');
var paths = {
gulpfile : 'gulpfile.js',
test : 'test/**/*.js',
source : 'src/**/*.js'
};
gulp.task('default', ['build']);
gulp.task('lint', function(done) {
return gulp.src([paths.test, paths.source])
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
});
gulp.task('test', ['lint'], function() {
return gulp.src(paths.test)
.pipe(mocha({reporter: 'spec'}));
});
gulp.task('build', ['test'], function() {
var bundled = browserify();
bundled.add('./src/index.js');
bundled.bundle()
.pipe(source('background.js'))
//.pipe(streamify(uglify()))
.pipe(gulp.dest('./build'));
});