-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
41 lines (36 loc) · 820 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
36
37
38
39
40
41
// Dependencies
var gulp = require('gulp');
var del = require('del');
var zip = require('gulp-zip');
var runSequence = require('run-sequence');
var install = require('gulp-install');
// Clean build dir
gulp.task('clean', function(cb) {
del('./build', cb);
});
// Move index.js over
gulp.task('js', function() {
gulp.src('index.js')
.pipe(gulp.dest('build/'))
});
// Install node modules
gulp.task('npm', function() {
gulp.src('./package.json')
.pipe(gulp.dest('./build/'))
.pipe(install({production: true}));
});
// Create .zip
gulp.task('zip', function() {
gulp.src(['build/**/*', '!build/package.json', 'build/.*'])
.pipe(zip('output.zip'))
.pipe(gulp.dest('./outputs'));
});
// Stage
gulp.task('stage', function(callback) {
return runSequence(
['clean'],
['js'],
['npm'],
callback
);
});