-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
32 lines (28 loc) · 809 Bytes
/
gulpfile.js
File metadata and controls
32 lines (28 loc) · 809 Bytes
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
/**
* @file
* Gulpfile for compiling Sass.
*/
const gulp = require('gulp');
const sass = require('gulp-sass');
const sourcemaps = require('gulp-sourcemaps');
const browsersync = require('browser-sync').create();
function style() {
return gulp
.src('./scss/**/*.scss')
.pipe(sourcemaps.init())
.pipe(sass({outputStyle: 'expanded'}).on('error', sass.logError))
.pipe(sourcemaps.write())
.pipe(gulp.dest('./css'))
.pipe(browsersync.stream());
}
function watch() {
browsersync.init({
proxy: 'http://website.local'
});
gulp.watch('scss/**/*.scss', style);
gulp.watch('js/**/*.js').on('change', browsersync.reload);
gulp.watch('*.theme').on('change', browsersync.reload);
gulp.watch('templates/**/*.twig').on('change', browsersync.reload);
}
exports.style = style;
exports.watch = watch;