-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
50 lines (44 loc) · 1.21 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
const gulp = require('gulp');
const sass = require('gulp-sass');
const sassGlob = require('gulp-sass-glob');
const autoprefixer = require('gulp-autoprefixer');
const gcmq = require('gulp-group-css-media-queries');
const cleanCSS = require('gulp-clean-css');
var plumber = require('gulp-plumber');
//var uglify = require('gulp-uglify');
var uglify = require('gulp-uglify-es').default;
var rename = require('gulp-rename');
const browsersync = require('browser-sync');
// Dev Paths
var js_dev = "./assets/dev_js/**/*.js";
// Dist Paths
var js_dist = "./assets/js";
function scripts(){
return(
gulp.src(js_dev)
.pipe(uglify())
.pipe(rename({suffix: ".min"}))
.pipe(gulp.dest(js_dist))
)
}
function compile(){
return(
gulp.src('./assets/sass/*.sass')
.pipe(sassGlob())
.pipe(sass({outputStyle:'compressed'}))
.pipe(gcmq())
.pipe(autoprefixer({
overrideBrowserslist: ['last 3 versions'],
cascade: false
}))
.pipe(cleanCSS())
.pipe(gulp.dest('./assets/css/'))
)
}
exports.compile = compile;
function watchfiles(){
gulp.watch('./assets/sass/**', compile);
gulp.watch('./assets/dev_js/**', scripts);
}
const watch = gulp.parallel(watchfiles)
exports.watch = watch;