-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
42 lines (37 loc) · 1.11 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
var gulp = require('gulp');
var rename = require('gulp-rename');
var browserify = require('gulp-browserify');
var uglify = require('gulp-uglify');
var preprocess = require('gulp-preprocess');
var jasmine = require('gulp-jasmine');
var sequence = require('gulp-run-sequence');
gulp.task('build', function() {
gulp.src('src/nanoflux.js')
.pipe(browserify({
standalone : 'NanoFlux'
}))
.pipe(gulp.dest('./dist'))
});
gulp.task('build:uglify', function() {
gulp.src('src/nanoflux.js')
.pipe(browserify({
standalone : 'NanoFlux'
}))
.pipe(uglify({
output : {
ascii_only : true
}
}))
.pipe(rename(function (path) {
path.basename += ".min";
}))
.pipe(gulp.dest('./dist'))
});
gulp.task('build:test', function() {
gulp.src('spec/*-spec.js')
.pipe(preprocess({context: {DIST: true}}))
.pipe(jasmine({verbose:true}));
});
gulp.task('default', function(cb){
sequence('build','build:uglify','build:test',cb);
});