-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathgulpfile.js
125 lines (100 loc) · 2.66 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
gulp = require('gulp');
plugins = require('gulp-load-plugins')();
fs = require('fs');
del = require('del');
path = require('path');
var staticJS = {
jquery: 'bower_components/jquery/dist/jquery.min.js',
chartjs: 'bower_components/Chart.js/dist/Chart.bundle.js',
nouislider: 'bower_components/nouislider/distribute/nouislider.min.js',
},
staticCss = {
nouislider: 'bower_components/nouislider/distribute/nouislider.min.css',
},
srcJS = [
'src/RangeSlider-core.js'
],
srcCSS = [
'src/RangeSlider-core.css'
]
outputDir = 'dist',
/* buildChains = {
solo: {
js: src,
chain: ['Build Source', 'Concat']
}
all: {
chain: ['Build Source']
js: [
staticJS.jquery,
staticJS.chartjs,
staticJS.nouislider,
src
],
css: [
staticCss.nouislider
]
}
}
*/
gulp.task('Start', function () {
del.sync([outputDir], {force: true})
return gulp
});
gulp.task('Finish', ['Start', 'Build All'], function () {
return gulp
});
gulp.task('default', ['Finish', 'Watch']);
gulp.task('Watch', function () {
gulp.watch('src/*', ['Finish'])
});
gulp.task('Build CSS', function () {
return gulp.src(srcCSS)
.pipe(plugins.autoprefixer())
//.pipe(plugins.minifyCSS())
.pipe(plugins.concat('RangeSlider-solo.min.css'))
.pipe(gulp.dest(outputDir));
});
gulp.task('Build Minimal CSS', ['Build CSS'], function () {
return gulp.src([
staticCss.nouislider,
outputDir + '/RangeSlider-solo.min.css'
])
.pipe(plugins.autoprefixer())
//.pipe(plugins.minifyCSS())
.pipe(plugins.concat('RangeSlider-minimal.min.css'))
.pipe(gulp.dest(outputDir));
});
gulp.task('Build All CSS', ['Build Minimal CSS'], function () {
return gulp.src([
staticCss.nouislider,
outputDir + '/RangeSlider-solo.min.css'
])
.pipe(plugins.autoprefixer())
//.pipe(plugins.minifyCSS())
.pipe(plugins.concat('RangeSlider-all.min.css'))
.pipe(gulp.dest(outputDir));
});
gulp.task('Build Source', ['Build All CSS'], function () {
return gulp.src(srcJS)
.pipe(plugins.uglify({mangle:false}))
.pipe(plugins.concat('RangeSlider-solo.min.js'))
.pipe(gulp.dest(outputDir));
});
gulp.task('Build Minimal', ['Build Source'], function () {
return gulp.src([
staticJS.nouislider,
outputDir + '/RangeSlider-solo.min.js'
])
.pipe(plugins.concat('RangeSlider-minimal.min.js'))
.pipe(gulp.dest(outputDir));
});
gulp.task('Build All', ['Build Minimal'], function () {
return gulp.src([
staticJS.jquery,
staticJS.chartjs,
outputDir + '//RangeSlider-minimal.min.js'
])
.pipe(plugins.concat('RangeSlider-all.min.js'))
.pipe(gulp.dest(outputDir));
});