-
-
Notifications
You must be signed in to change notification settings - Fork 210
/
gulpfile.js
69 lines (63 loc) · 1.87 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
'use strict';
var gulp = require('gulp'),
minifyCss = require('gulp-minify-css'),
uglify = require('gulp-uglify'),
ngAnnotate = require('gulp-ng-annotate'),
concat = require('gulp-concat'),
del = require('del'),
merge = require('merge2');
var path = {
dest: './public/',
js_min: [
'public/js/lib/material.min.js',
'public/js/lib/loading-bar.min.js',
'public/bower/ng-dialog/js/ngDialog.min.js',
'public/bower/angular-aria/angular-aria.min.js',
'public/bower/angular-cookies/angular-cookies.min.js',
'public/bower/tinycolor/dist/tinycolor-min.js',
'public/bower/angular-material/angular-material.min.js',
'public/bower/md-color-picker/dist/mdColorPicker.min.js'
],
js_src: [
'public/js/main.js',
'public/js/app/constant.js',
'public/js/app/directive.js',
'public/js/app/core.service.js',
'public/js/app/root.ctrl.js'
],
css_src: [
'public/css/bootstrap-material-design.min.css',
'public/css/loading-bar.min.css',
'public/bower/ng-dialog/css/ngDialog.min.css',
'public/bower/ng-dialog/css/ngDialog-theme-default.min.css',
'public/bower/angular-material/angular-material.min.css',
'public/bower/md-color-picker/dist/mdColorPicker.min.css',
'public/css/main.css'
]
};
gulp.task('css', function() {
return gulp.src(path.css_src)
.pipe(minifyCss())
.pipe(concat('all.css'))
.pipe(gulp.dest(path.dest + 'css/'));
});
gulp.task('js', function () {
return merge(
gulp.src(path.js_min),
gulp.src(path.js_src)
.pipe(ngAnnotate())
.pipe(uglify())
)
.pipe(concat('all.js'))
.pipe(gulp.dest(path.dest + 'js/'));
});
gulp.task('clean', function() {
return new Promise((resolve => {
del.bind(null, [
path.dest
]);
resolve();
}))
});
gulp.task('build', gulp.series('clean', gulp.parallel(['css', 'js'])));
gulp.task('default', gulp.parallel('build'));