forked from angular/batarang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
43 lines (37 loc) · 1.16 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
var gulp = require('gulp');
var source = require('vinyl-source-stream');
var browserify = require('browserify');
var zip = require('gulp-zip');
var main = require('./package.json').main;
// TODO: make sure manifest version === package.json version
var version = require('./manifest.json').version;
gulp.task('watch', function(){
gulp.watch(['hint.js', '!./dist/*.js'], ['browserify']);
});
gulp.task('browserify', function() {
var bundleStream = browserify('./' + main).bundle().pipe(source(main));
return bundleStream.pipe(gulp.dest('./dist'));
});
/*
* I use this to make a zip for the chrome store
*/
gulp.task('package', ['browserify'], function () {
return gulp.src([
'./dist/**',
'./img/**',
'./panel/**',
'background.js',
'devtoolsBackground.*',
'inject.js',
'manifest.json',
'./node_modules/angular/angular.js',
'./node_modules/browserify-eep/out.js'
], {base: '.'})
.pipe(gulp.dest('./package'));
});
gulp.task('zip', ['package'], function () {
return gulp.src('package/**')
.pipe(zip('batarang-' + version + '.zip'))
.pipe(gulp.dest('.'));
});
gulp.task('default', ['browserify']);