-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
65 lines (52 loc) · 1.54 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
var gulp = require("gulp");
var browserify = require("browserify");
var source = require('vinyl-source-stream');
var uglify = require('gulp-uglify');
var copy = require('gulp-copy');
var rename = require("gulp-rename");
var clean = require('gulp-clean');
var folders = require('gulp-folders');
var concat = require('gulp-concat');
/*
gulp.task('unify-core',function(){
return browserify('./src/package-core.js')
.bundle()
.pipe(source('monkeyman.js'))
.pipe(gulp.dest('./build/'))
})
*/
gulp.task('unify-core', function() {
return gulp.src('./src/core/*.js')
.pipe(concat('monkeyman.js'))
.pipe(gulp.dest('./build/'));
});
gulp.task('uglify-core',['unify-core'],function(){
return gulp.src('./build/monkeyman.js')
.pipe(uglify())
.pipe(rename(function(path){
path.basename += '.min'
}))
.pipe(gulp.dest('./build/'))
});
gulp.task('compile-core',['unify-core','uglify-core']);
/*gulp.task('unify-ui',function(){
return browserify('./src/package-ui.js')
.bundle()
.pipe(source('monkeyman-ui.js'))
.pipe(gulp.dest('./build/'))
});*/
gulp.task('unify-ui', function() {
return gulp.src('./src/ui/**/*.js')
.pipe(concat('monkeyman-ui.js'))
.pipe(gulp.dest('./build/'));
});
gulp.task('uglify-ui',['unify-ui'],function(){
return gulp.src('./build/monkeyman-ui.js')
.pipe(uglify())
.pipe(rename(function(path){
path.basename += '.min'
}))
.pipe(gulp.dest('./build/'))
});
gulp.task('compile-ui',['unify-ui','uglify-ui']);
gulp.task('compile-all',['compile-core','compile-ui']);