forked from ThemeAvenue/BetterOptin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
89 lines (86 loc) · 2.33 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
var gulp = require('gulp');
var plumber = require('gulp-plumber');
var postcss = require('gulp-postcss');
var autoprefixer = require('autoprefixer');
var concat = require('gulp-concat');
var jshint = require('gulp-jshint');
var uglify = require('gulp-uglify');
var minifycss = require('gulp-minify-css');
var less = require('gulp-less');
var stripDebug = require('gulp-strip-debug');
gulp.task('styles', function () {
gulp.src(['public/assets/css/**/*.less'])
.pipe(plumber({
errorHandler: function (error) {
console.log(error.message);
this.emit('end');
}
}))
.pipe(less())
.pipe(postcss([autoprefixer({
browsers: ['last 2 versions']
})]))
.pipe(gulp.dest('public/assets/css/'))
.pipe(minifycss({
keepSpecialComments: false
}))
.pipe(gulp.dest('public/assets/css/'))
gulp.src(['admin/assets/css/admin.less'])
.pipe(plumber({
errorHandler: function (error) {
console.log(error.message);
this.emit('end');
}
}))
.pipe(less())
.pipe(postcss([autoprefixer({
browsers: ['last 2 versions']
})]))
.pipe(gulp.dest('admin/assets/css/'))
.pipe(minifycss({
keepSpecialComments: false
}))
.pipe(gulp.dest('admin/assets/css/'))
gulp.src(['admin/assets/css/ta-editor.less'])
.pipe(plumber({
errorHandler: function (error) {
console.log(error.message);
this.emit('end');
}
}))
.pipe(less())
.pipe(postcss([autoprefixer({
browsers: ['last 2 versions']
})]))
.pipe(gulp.dest('admin/assets/css/'))
.pipe(minifycss({
keepSpecialComments: false
}))
.pipe(gulp.dest('admin/assets/css/'))
});
gulp.task('scripts', function () {
return gulp.src([
'./bower_components/easyModal.js/jquery.easyModal.js',
'./bower_components/jquery.cookie/jquery.cookie.js',
'./bower_components/matchHeight/jquery.matchHeight.js',
'./public/assets/js/**/*.js',
'!./public/assets/js/**/*min.js'
])
.pipe(plumber({
errorHandler: function (error) {
console.log(error.message);
this.emit('end');
}
}))
// .pipe(jshint())
// .pipe(jshint.reporter('default'))
.pipe(concat('betterOptin.min.js'))
.pipe(gulp.dest('public/assets/js/'))
.pipe(stripDebug())
.pipe(uglify())
.pipe(gulp.dest('public/assets/js/'))
});
gulp.task('default', function () {
gulp.watch('public/assets/css/**/*.less', ['styles']);
gulp.watch('public/assets/js/**/*.js', ['scripts']);
});