-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
33 lines (25 loc) · 848 Bytes
/
gulpfile.js
File metadata and controls
33 lines (25 loc) · 848 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
33
const gulp = require('gulp'),
browserSync = require('browser-sync').create(),
sass = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer');
const wpPath = './wp-content/themes/bringing-ideas'
const dockerPort = 8000
gulp.task('serve', ['sass'], function() {
browserSync.init({
proxy: `localhost:${dockerPort}`,
open: false
});
gulp.watch(`${wpPath}/*.php`).on('change', browserSync.reload);
gulp.watch(`${wpPath}/sass/**/*.sass`, ['sass']);
});
gulp.task('sass', function() {
return gulp.src(`${wpPath}/sass/style.sass`)
.pipe(sass({
errLogToConsole: true,
outputStyle: 'compressed'
}).on('error', sass.logError))
.pipe(autoprefixer())
.pipe(gulp.dest(`${wpPath}/`))
.pipe(browserSync.stream());
});
gulp.task('default', ['serve']);