Created
December 21, 2018 04:29
-
-
Save fstiehle/d0f35927c0face0560036acb46ed94e9 to your computer and use it in GitHub Desktop.
Gulp + WordPress + SASS + Autoprefix + LiveReload
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
var gulp = require('gulp'), | |
sass = require('gulp-sass'), | |
autoprefixer = require('gulp-autoprefixer'), | |
rename = require('gulp-rename'), | |
livereload = require('gulp-livereload'); | |
gulp.task('sass', function () { | |
return gulp.src('./sass/style.scss') | |
.pipe(sass.sync().on('error', sass.logError)) | |
.pipe(autoprefixer('last 2 versions')) | |
.pipe(gulp.dest('./')) | |
.pipe(sass.sync({outputStyle: 'compressed'}).on('error', sass.logError)) | |
.pipe(rename({ suffix: '.min' })) | |
.pipe(livereload()) | |
.pipe(gulp.dest('./')); | |
}); | |
gulp.task('php', function () { | |
return gulp.src('./php/*.php') | |
.pipe(gulp.dest('./')); | |
}); | |
gulp.task('default', function () { | |
livereload.listen(35729); | |
gulp.watch('./sass/**/*.scss', gulp.series('sass')).on('change', livereload.changed); | |
gulp.watch('**/*.php', gulp.series('php')).on('change', livereload.changed); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment