-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
55 lines (46 loc) · 1.61 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
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var cleanCSS = require('gulp-clean-css');
var order = require("gulp-order");
var autoprefixer = require("gulp-autoprefixer");
// COMPILE SASS
gulp.task('sass', function () {
return gulp.src('./public/assets/sass/**/*.scss')
.pipe(sourcemaps.init())
.pipe(sass.sync().on('error', sass.logError))
.pipe(cleanCSS({compatibility: 'ie8'}))
.pipe(autoprefixer({
browsers: ['last 2 versions']
}))
.pipe(gulp.dest('./public/dist/css'));
});
// CONCATENATE AND MINIFY JS
gulp.task('scripts', function() {
return gulp.src("public/assets/js/**/*.js")
.pipe(order([
'vendors/jquery.fancybox.min.js',
'vendors/owl.carousel.min.js',
'vendors/eqHeight.js',
'vendors/scrollme.js',
'vendors/vid.js',
'vendors/validate.js',
'vendors/additional-methods.js',
'vendors/jquery.forms.js',
'vendors/stacktable.js',
'forms.js',
'custom.js'
]))
.pipe(concat("all.js"))
.pipe(rename('scripts.min.js'))
.pipe(uglify())
.pipe(gulp.dest("./public/dist/js"));
});
gulp.task('default', function () {
gulp.watch('./public/assets/sass/**/*.scss', ['sass']);
gulp.watch('./public/assets/js/**/*.js', ['scripts']);
});