This repository has been archived on 2020-10-11. You can view files and clone it, but cannot push or open issues or pull requests.
angularjs-batarang/gulpfile.js
2014-12-09 21:02:52 -08:00

43 lines
1.1 KiB
JavaScript

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 === 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('.'));
});
gulp.task('default', ['browserify']);