This repository has been archived by the owner on Nov 28, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 160
/
Gulpfile.js
79 lines (70 loc) · 2.91 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
var gulp = require('gulp');
var util = require('gulp-util');
var clean = require('gulp-clean');
var header = require('gulp-header');
var less = require('gulp-less');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var minifyCss = require('gulp-minify-css');
var pkg = require('./package.json');
var currentYear = util.date(new Date(), 'yyyy');
var paths = {
scripts: [
'./bootstrap-progressbar.js'
],
styles: [
'./resources/bootstrap-progressbar-2.0.0.less',
'./resources/bootstrap-progressbar-2.0.1.less',
'./resources/bootstrap-progressbar-2.0.2.less',
'./resources/bootstrap-progressbar-2.0.3.less',
'./resources/bootstrap-progressbar-2.0.4.less',
'./resources/bootstrap-progressbar-2.1.0.less',
'./resources/bootstrap-progressbar-2.1.1.less',
'./resources/bootstrap-progressbar-2.2.0.less',
'./resources/bootstrap-progressbar-2.2.1.less',
'./resources/bootstrap-progressbar-2.2.2.less',
'./resources/bootstrap-progressbar-2.3.0.less',
'./resources/bootstrap-progressbar-2.3.1.less',
'./resources/bootstrap-progressbar-2.3.2.less',
'./resources/bootstrap-progressbar-3.0.0-rc1.less',
'./resources/bootstrap-progressbar-3.0.0-rc2.less',
'./resources/bootstrap-progressbar-3.0.0.less',
'./resources/bootstrap-progressbar-3.0.1.less',
'./resources/bootstrap-progressbar-3.0.2.less',
'./resources/bootstrap-progressbar-3.0.3.less',
'./resources/bootstrap-progressbar-3.1.0.less',
'./resources/bootstrap-progressbar-3.1.1.less',
'./resources/bootstrap-progressbar-3.2.0.less',
'./resources/bootstrap-progressbar-3.3.0.less',
'./resources/bootstrap-progressbar-3.3.1.less',
'./resources/bootstrap-progressbar-3.3.2.less',
'./resources/bootstrap-progressbar-3.3.4.less',
]
};
var banner = '/*! <%= pkg.name %> v<%= pkg.version %> | Copyright (c) 2012-<%= currentYear %> <%= pkg.author %> | <%= pkg.license %> license | <%= pkg.homepage %> */\n';
gulp.task('scripts', function() {
return gulp.src(paths.scripts)
.pipe(uglify())
.pipe(header(banner, {pkg: pkg, currentYear: currentYear}))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('.'));
});
gulp.task('styles', function() {
return gulp.src(paths.styles)
.pipe(less())
.pipe(header(banner, {pkg: pkg, currentYear: currentYear}))
.pipe(gulp.dest('./css'));
});
gulp.task('styles-min', function() {
return gulp.src(paths.styles)
.pipe(less())
.pipe(minifyCss())
.pipe(header(banner, {pkg: pkg, currentYear: currentYear}))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('./css'));
});
gulp.task('clean', function() {
return gulp.src('./css', {read: false})
.pipe(clean());
});
gulp.task('default', ['clean', 'scripts', 'styles', 'styles-min']);