Skip to content

Instantly share code, notes, and snippets.

@RuNpiXelruN
Created May 17, 2018 23:43
Show Gist options
  • Save RuNpiXelruN/1bb00535bbd65e9567ea589c4c73c096 to your computer and use it in GitHub Desktop.
Save RuNpiXelruN/1bb00535bbd65e9567ea589c4c73c096 to your computer and use it in GitHub Desktop.
var gulp = require('gulp'),
sass = require('gulp-sass'),
concat = require('gulp-concat'),
browserSync = require('browser-sync').create();
gulp.task('serve', ['sass'], function() {
browserSync.init({
proxy: "http://daf.test"
});
gulp.watch("./wp-content/themes/twentyseventeen-child/scss/**/*.scss", ['sass']);
gulp.watch('./wp-content/themes/twentyseventeen-child/**/*.php').on('change', browserSync.reload);
// gulp.watch("app/*.html").on('change', browserSync.reload);
});
// Compile sass into CSS & auto-inject into browsers
gulp.task('sass', function() {
return gulp.src("./wp-content/themes/twentyseventeen-child/scss/index.scss")
.pipe(sass({
'outputStyle': 'compressed'
}))
.pipe(concat('style.css'))
.pipe(gulp.dest('./wp-content/themes/twentyseventeen-child/'))
.pipe(browserSync.stream());
});
gulp.task('default', ['serve']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment