Skip to content

Instantly share code, notes, and snippets.

@snapeuh
Created February 13, 2020 08:35
Show Gist options
  • Save snapeuh/ecf9e7b659b21745c2a2bf661fd45fcf to your computer and use it in GitHub Desktop.
Save snapeuh/ecf9e7b659b21745c2a2bf661fd45fcf to your computer and use it in GitHub Desktop.
Example gulfile for WP + Bedrock
'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