-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
45 lines (39 loc) · 1.2 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
//* Vars
const gulp = require('gulp');
const sass = require('gulp-sass')(require('sass')); // Ensure 'sass' is used here
var sourcemaps = require('gulp-sourcemaps');
var sassGlob = require('gulp-sass-glob');
const cleanCSS = require('gulp-clean-css');
gulp.task('rentfetch-style', function () {
return gulp
.src('css/rentfetch-style.scss')
.pipe(sassGlob())
.pipe(sourcemaps.init())
.pipe(sass().on('error', sass.logError))
.pipe(sourcemaps.write())
.pipe(gulp.dest('css/'));
});
gulp.task('rentfetch-style-prod', function () {
return gulp
.src('css/rentfetch-style.scss')
.pipe(sassGlob())
.pipe(sass().on('error', sass.logError))
.pipe(cleanCSS({ compatibility: 'ie8' }))
.pipe(gulp.dest('css/'));
});
gulp.task('admin', function () {
return gulp
.src('css/admin.scss')
.pipe(sassGlob())
.pipe(sass().on('error', sass.logError))
.pipe(cleanCSS({ compatibility: 'ie8' }))
.pipe(gulp.dest('css/'));
});
//* Watchers here
gulp.task('watch', function () {
gulp.watch('css/**/*.scss', gulp.series(['rentfetch-style', 'admin']));
});
gulp.task('prod', function () {
gulp.watch('css/**/*.scss', gulp.series(['rentfetch-style-prod', 'admin']));
});
gulp.task('default', gulp.series(['watch']));