-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
42 lines (36 loc) · 1.09 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
var gulp = require('gulp'),
sass = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer'),
browserSync = require('browser-sync').create();
// Set paths for tasks
var paths = {
html: ['*.php', '*.html'],
scss: ['public/assets/sass/*.scss', 'public/assets/sass/**/*.scss']
};
// Extension filter for gulp-filter
var filterByExtension = function (extension) {
return filter(function (file) {
return file.path.match(new RegExp('.' + extension + '$'));
});
};
gulp.task('scss', function () {
gulp.src(paths.scss)
.pipe(sass())
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(gulp.dest('public/assets/css/.'))
.once('error', function () {
process.exit(1);
})
.once('end', function () {
process.exit();
});
//.pipe(browserSync.stream());
});
gulp.task('watch', function () {
gulp.watch(paths.scss, ['scss']);
//gulp.watch(paths.html).on('change', browserSync.reload);
});
gulp.task('default', ['watch', 'scss']);