Last active
July 14, 2021 07:39
-
-
Save barbwiredmedia/406ea51bc67aaae9a5b4 to your computer and use it in GitHub Desktop.
Gulp File , sass, browser-sync, local development. Assumes folder structure /assets/styles/ & /assets/js/
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'); | |
var gutil = require('gulp-util'); | |
var sass = require('gulp-sass'); | |
var browserSync = require('browser-sync').create(); | |
var reload = browserSync.reload; | |
gulp.task('sass', function () { | |
gulp.src('./assets/styles/**/*.scss') | |
.pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError)) | |
.pipe(gulp.dest('./assets/styles')); | |
//.pipe(notify({ message: 'You so Sassy!' })); | |
}); | |
gulp.task('browser-sync', function () { | |
browserSync.init(["./assets/styles/**/*.scss", "./assets/js/*.js", "*.php"], { | |
// server: { | |
proxy: "localurl.dev" | |
// } | |
}); | |
}); | |
gulp.task('watch', ['sass', 'browser-sync'], function () { | |
gulp.watch('./assets/styles/**/*scss', ['sass']); | |
gulp.watch("*.html").on("change", reload); | |
}); |
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
{ | |
"devDependencies": { | |
"browser-sync": "^2.7.1", | |
"gulp": "^3.8.11", | |
"gulp-sass": "^2.0.0", | |
"gulp-util": "^3.0.4" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Needs work to add error reporting, linting, etc.