-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
88 lines (72 loc) · 2.3 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
var gulp = require("gulp"),
uglify = require('gulp-uglify'),
browserify = require('browserify'),
source = require('vinyl-source-stream'),
buffer = require('vinyl-buffer'),
git = require('gulp-git'),
qunit = require('gulp-qunit'),
bump = require('gulp-bump');
///////////////////////////////////////////////////////////////////////////////
gulp.task('scripts', scripts);
gulp.task('test', ["scripts"], test);
gulp.task('watch', ["scripts"], watch);
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
function scripts() {
browserify({
debug: false,
entries: ['./build_helper/objct.js']
})
.bundle()
.pipe(source('objct.js'))
.pipe(buffer())
.pipe(uglify({
"preserveComments" : "some"
}))
.pipe(gulp.dest('./dist/'))
;
browserify({
debug: false,
entries: ['./build_helper/objct.e.js']
})
.bundle()
.pipe(source('objct.e.js'))
.pipe(buffer())
.pipe(uglify({
"preserveComments" : "some"
}))
.pipe(gulp.dest('./dist/'))
;
}
///////////////////////////////////////////////////////////////////////////////
function test() {
gulp.src('test/objct.html').
pipe(qunit());
gulp.src('test/objct.e.html').
pipe(qunit());
}
///////////////////////////////////////////////////////////////////////////////
function watch(){
gulp.watch(["./package.json", "./objct.js"], ['scripts']);
}
///////////////////////////////////////////////////////////////////////////////
/* Deploy - Test when next deploy ready*/
// gulp.task('bump', function () {
// return gulp.src(['./package.json', './bower.json'])
// .pipe(bump())
// .pipe(gulp.dest('./'));
// });
// gulp.task('tag',["bump"], function () {
// var pkg = require('./package.json');
// var v = 'v' + pkg.version;
// var message = 'Release ' + v;
// return gulp.src('./')
// .pipe(git.commit(message))
// .pipe(git.tag(v, message))
// .pipe(git.push('origin', 'Master', '--tags'))
// .pipe(gulp.dest('./'));
// });
// gulp.task('deploy' ,["tag"], function (done) {
// require('child_process').spawn('npm', ['publish'], { stdio: 'inherit' })
// .on('close', done);
// });