This repository was archived by the owner on Oct 18, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 335
Expand file tree
/
Copy pathgulpfile.js
More file actions
57 lines (50 loc) · 1.72 KB
/
gulpfile.js
File metadata and controls
57 lines (50 loc) · 1.72 KB
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 source = require('vinyl-source-stream');
var browserify = require('browserify');
var zip = require('gulp-zip');
var protractor = require("gulp-protractor").protractor;
var webdriver_standalone = require("gulp-protractor").webdriver_standalone;
var webdriver_update = require("gulp-protractor").webdriver_update;
var main = require('./package.json').main;
// TODO: make sure manifest version === package.json version === bower.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'
], {base: '.'})
.pipe(gulp.dest('./package'));
});
gulp.task('zip', ['package'], function () {
return gulp.src('package/**')
.pipe(zip('batarang-' + version + '.zip'))
.pipe(gulp.dest('.'));
});
// protractor and selenium
gulp.task('webdriver_update', webdriver_update);
gulp.task('webdriver_standalone', webdriver_standalone);
gulp.task('test', ['webdriver_update'], function() {
return gulp.src(["./tests/*.js"])
.pipe(protractor({
configFile: "protractor.config.js",
args: ['--baseUrl', 'http://127.0.0.1:8000']
}))
.on('error', function(e) { throw e; })
});
gulp.task('default', ['browserify']);