Created
February 13, 2020 08:35
-
-
Save snapeuh/ecf9e7b659b21745c2a2bf661fd45fcf to your computer and use it in GitHub Desktop.
Example gulfile for WP + Bedrock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const gulp = require('gulp'); | |
const sass = require('gulp-sass'); | |
const sourcemaps = require('gulp-sourcemaps'); | |
const autoprefixer = require('gulp-autoprefixer'); | |
const browserSync = require('browser-sync').create(); | |
gulp.task('sass', function () { | |
return gulp.src('web/app/themes/**/css/*.scss', { base: './' }) | |
.pipe(sourcemaps.init()) | |
.pipe(sass().on('error', sass.logError)) | |
.pipe(autoprefixer({ | |
browsers: ['last 3 versions'] | |
})) | |
.pipe(sourcemaps.write('.')) | |
.pipe(gulp.dest('.')) | |
.pipe(browserSync.stream()); | |
}); | |
gulp.task('serve', function () { | |
browserSync.init({ | |
proxy: 'localhost:8183', | |
ghostMode: false, | |
open: false | |
}); | |
gulp.watch('./web/app/themes/**/css/*.scss', ['sass']); | |
gulp.watch('./web/app/themes/**/*.php').on('change', browserSync.reload); | |
gulp.watch('./web/app/themes/**/*.js').on('change', browserSync.reload); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment