forked from ivinteractive/kirbycms-redirects
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
54 lines (45 loc) · 1.28 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
var gulp = require('gulp'),
sass = require('gulp-sass'),
csso = require('gulp-csso'),
autoprefixer = require('gulp-autoprefixer'),
shorthand = require('gulp-shorthand'),
notify = require('gulp-notify'),
plumber = require('gulp-plumber'),
watch = require('gulp-watch'),
runSequence = require('run-sequence');
var paths = {
scss: './resources/scss',
css: './assets/css'
};
gulp.task('view', function() {
gulp.src(paths.scss + '/redirecty.scss')
.pipe(plumber({errorHandler: notify.onError("SASS error: <%= error.message %> in <%= error.filename %>")}))
.pipe(sass({
outputStyle: 'expanded',
}))
.pipe(csso())
.pipe(autoprefixer({
browsers: ['> 1%'],
cascade: false
}))
.pipe(gulp.dest(paths.css));
});
gulp.task('widget', function() {
gulp.src(paths.scss + '/widget.scss')
.pipe(plumber({errorHandler: notify.onError("SASS error: <%= error.message %> in <%= error.filename %>")}))
.pipe(sass({
outputStyle: 'expanded',
}))
.pipe(csso())
.pipe(autoprefixer({
browsers: ['> 1%'],
cascade: false
}))
.pipe(gulp.dest(paths.css));
});
gulp.task('sass', function() {
runSequence('view', 'widget');
});
gulp.task('default', function() {
gulp.watch(paths.scss + '/*.scss', ['view', 'widget']);
});