-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
49 lines (42 loc) · 1.45 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
//Gulp Plugins
var gulp = require('gulp'),
rename = require("gulp-rename"),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
minify = require('gulp-clean-css'),
watch = require('gulp-watch');
// Paths to resources
var JS_PATH = [
'vendor/bower/owl.carousel/dist/owl.carousel.js',
'vendor/bower/jquery-stickit/build/jquery.stickit.min.js',
'web/js/custom/scripts.js',
'web/js/custom/menu.js'
],
CSS_PATH = [
'vendor/bower/animate.css/animate.css',
'vendor/bower/owl.carousel/dist/assets/owl.carousel.css',
'vendor/bower/owl.carousel/dist/assets/owl.carousel.theme.default.css',
'web/css/custom/*.css'
];
//task compile js
gulp.task('simblog:min:js', function () {
return gulp.src(JS_PATH)
.pipe(uglify())
.pipe(concat('simblog.min.js'))
.pipe(rename({dirname: 'js'}))
.pipe(gulp.dest('web/'));
});
//task compile ss
gulp.task('simblog:min:css', function () {
return gulp.src(CSS_PATH)
.pipe(minify({rebase: false, keepSpecialComments : 0}))
.pipe(concat('simblog.min.css'))
.pipe(rename({dirname: 'css'}))
.pipe(gulp.dest('web/'));
});
//watching changes in css and js
gulp.task('watch', ['simblog:min:css', 'simblog:min:js'], function() {
gulp.watch('web/public/**/*.css', ['simblog:min:css']);
gulp.watch('web/public/**/*.js', ['simblog:min:js']);
});
gulp.task('default', ['watch']);