forked from ansible/galaxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
97 lines (88 loc) · 3.15 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
89
90
91
92
93
94
95
96
97
var gulp = require('gulp');
var less = require('gulp-less');
var dest = require('gulp-dest');
var watch = require('gulp-watch');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var gutil = require('gulp-util');
gulp.task('accountApp', function() {
return gulp.src([
'./galaxy/static/js/accountApp/*.js',
'./galaxy/static/js/commonDirectives/*.js',
'./galaxy/static/js/commonServices/*.js'
])
.pipe(concat('galaxy.accountApp.js'))
.pipe(uglify({ 'mangle': true, 'compress': true }))
.pipe(rename({extname: ".min.js"}))
.pipe(gulp.dest('./galaxy/static/dist'));
});
gulp.task('detailApp', function() {
return gulp.src([
'./galaxy/static/js/detailApp/*.js',
'./galaxy/static/js/commonDirectives/*.js',
'./galaxy/static/js/commonServices/*.js'
])
.pipe(concat('galaxy.detailApp.js'))
.pipe(uglify({ 'mangle': true, 'compress': true }))
.pipe(rename({extname: ".min.js"}))
.pipe(gulp.dest('./galaxy/static/dist'));
});
gulp.task('listApp', function() {
return gulp.src([
'./galaxy/static/js/listApp/*.js',
'./galaxy/static/js/commonDirectives/*.js',
'./galaxy/static/js/commonServices/*.js'
])
.pipe(concat('galaxy.listApp.js'))
.pipe(uglify({ 'mangle': true, 'compress': true }))
.pipe(rename({extname: ".min.js"}))
.pipe(gulp.dest('./galaxy/static/dist'));
});
gulp.task('exploreApp', function() {
return gulp.src([
'./galaxy/static/js/exploreApp/*.js',
'./galaxy/static/js/commonDirectives/*.js',
'./galaxy/static/js/commonServices/*.js'
])
.pipe(concat('galaxy.exploreApp.js'))
.pipe(uglify({ 'mangle': true, 'compress': true }))
.pipe(rename({extname: ".min.js"}))
.pipe(gulp.dest('./galaxy/static/dist'));
});
gulp.task('importStatusApp', function() {
return gulp.src([
'./galaxy/static/js/importStatusApp/*.js',
'./galaxy/static/js/commonDirectives/*.js',
'./galaxy/static/js/commonServices/*.js'
])
.pipe(concat('galaxy.importStatusApp.js'))
.pipe(uglify({ 'mangle': true, 'compress': true }))
.pipe(rename({extname: ".min.js"}))
.pipe(gulp.dest('./galaxy/static/dist'));
});
gulp.task('roleAddApp', function() {
return gulp.src([
'./galaxy/static/js/roleAddApp/*.js',
'./galaxy/static/js/commonDirectives/*.js',
'./galaxy/static/js/commonServices/*.js'
])
.pipe(concat('galaxy.roleAddApp.js'))
.pipe(uglify({ 'mangle': true, 'compress': true }))
.pipe(rename({extname: ".min.js"}))
.pipe(gulp.dest('./galaxy/static/dist'));
});
gulp.task('less', function() {
return gulp.src(['./galaxy/static/less/galaxy.less'])
.pipe(less({
compress: true
}))
.on('error', gutil.log)
.pipe(dest('galaxy/static/css', {ext: '.min.css'}))
.pipe(gulp.dest('./'));
});
gulp.task('watch', function () {
gulp.watch('./galaxy/static/less/*.less',['less']);
});
gulp.task('default', ['less','watch']);
gulp.task('build', ['less', 'accountApp', 'listApp', 'detailApp', 'exploreApp', 'roleAddApp', 'importStatusApp']);