-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
64 lines (54 loc) · 1.42 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
const gulp = require('gulp');
const sass = require('gulp-sass');
const rename = require('gulp-rename');
const autoprefixer = require('gulp-autoprefixer');
// Cactu scss source
const cactuUrl = './scss/**/*.scss';
const docUrl = './_sass/**/*.scss';
const sassOpts = {
outputStyle: 'compressed',
precison: 3,
errLogToConsole: true
};
function styles() {
return gulp.src(cactuUrl)
.pipe(sass({
outputStyle: 'expanded'
}).on('error', sass.logError))
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(gulp.dest('./css'))
};
function docStyles() {
return gulp.src(docUrl)
.pipe(sass(sassOpts).on('error', sass.logError))
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(rename({
suffix: ".min"
}))
.pipe(gulp.dest('./assets/css'))
}
function compressedStyles() {
return gulp.src(cactuUrl)
.pipe(sass(sassOpts).on('error', sass.logError))
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(rename({
suffix: ".min"
}))
.pipe(gulp.dest('./css'))
}
gulp.task('sass', styles);
gulp.task('sass-doc', docStyles);
gulp.task('sass-compressed', compressedStyles);
gulp.task('cactu-build', gulp.parallel(styles, compressedStyles));
gulp.task('watch', () => {
gulp.watch([cactuUrl, docUrl], gulp.series(styles, compressedStyles, docStyles));
});