-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
39 lines (30 loc) · 862 Bytes
/
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
'use strict';
var autoprefixer = require('gulp-autoprefixer');
var csso = require('gulp-csso');
var del = require('del');
var gulp = require('gulp');
var runSequence = require('gulp4-run-sequence');
var sass = require('gulp-sass');
// Gulp task to minify SASS files
gulp.task('styles', function() {
return gulp.src('./**/main.scss')
// Compile SASS files
.pipe(sass({
outputStyle: 'nested',
precision: 10,
includePaths: ['.'],
onError: console.error.bind(console, 'SASS error:')
}))
// Auto-prefix css styles for cross browser compatibility
.pipe(autoprefixer())
// Minify the file
.pipe(csso())
// Output
.pipe(gulp.dest('./dist'))
});
// Clean output directory
gulp.task('clean', () => del(['dist']));
// Gulp task to minify all files
gulp.task('default', gulp.series('clean', function(done) {
runSequence([ 'styles', done ]);
}));