-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGulpfile.js
36 lines (31 loc) · 986 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
'use strict';
var gulp = require('gulp'),
bump = require('gulp-bump'),
concat = require('gulp-concat'),
del = require('del'),
livereload = require('gulp-livereload'),
mocha = require('gulp-mocha'),
newer = require('gulp-newer'),
sourcemaps = require('gulp-sourcemaps'),
uglify = require('gulp-uglify');
gulp.task('build', function() {
gulp.src('storage.js')
.pipe(sourcemaps.init())
.pipe(uglify())
.pipe(concat('storage.min.js'))
.pipe(sourcemaps.write())
.pipe(gulp.dest('.'));
gulp.src('package.json')
.pipe(bump({type: 'prerelease'}))
.pipe(gulp.dest('.'));
});
gulp.task('test', function() {
return gulp.src('spec.js', {read: false})
.pipe(mocha());
});
gulp.task('watch', function() {
livereload.listen();
gulp.watch('storage.js').on('change', livereload.changed);
gulp.watch(['storage.js', 'spec.js'], ['test']);
});
gulp.task('default', ['test', 'watch']);