-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
48 lines (41 loc) · 1.31 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
var gulp = require('gulp'),
less = require('gulp-less'),
minify = require('gulp-clean-css'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat');
var paths = {
'dev': {
'less': './resources/less/',
'js': './resources/js/'
},
'production': './assets/'
};
gulp.task('js', function () {
return gulp.src(paths.dev.js + '*.js')
.pipe(concat('calendar.js'))
.pipe(gulp.dest(paths.production));
});
gulp.task('jsMin', function () {
return gulp.src(paths.dev.js + '*.js')
.pipe(concat('calendar.min.js'))
.pipe(uglify())
.pipe(gulp.dest(paths.production));
});
gulp.task('css', function () {
return gulp.src(paths.dev.less + '*.less')
.pipe(concat('calendar.css'))
.pipe(less())
.pipe(gulp.dest(paths.production));
});
gulp.task('cssMin', function () {
return gulp.src(paths.dev.less + '*.less')
.pipe(concat('calendar.min.css'))
.pipe(less())
.pipe(minify({keepSpecialComments: 0}))
.pipe(gulp.dest(paths.production));
});
gulp.task('watch', function () {
gulp.watch(paths.dev.js + '*.js', gulp.series('js', 'jsMin'));
gulp.watch(paths.dev.less + '*.less', gulp.series('css', 'cssMin'));
});
gulp.task('default', gulp.series('js', 'jsMin', 'css', 'cssMin', 'watch'));