Skip to content

Instantly share code, notes, and snippets.

@sunilw
Created February 18, 2018 06:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sunilw/efdeb6e5f87789a315cc38dc7709a255 to your computer and use it in GitHub Desktop.
Save sunilw/efdeb6e5f87789a315cc38dc7709a255 to your computer and use it in GitHub Desktop.
var gulp = require('gulp') ;
var sass = require('gulp-sass') ;
var watch = require('gulp-watch') ;
var sourcemaps = require('gulp-sourcemaps') ;
var browserSync = require('browser-sync');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var combiner = require('stream-combiner2');
gulp.task('watch', function () {
gulp.watch('./src/sass/**.scss', ['sass']);
gulp.watch('./src/js/**.js', ['scripts']);
});
gulp.task( 'sass', function() {
return gulp.src('./src/sass/**.scss')
.pipe(sourcemaps.init())
.pipe(sass().on('error', sass.logError))
.pipe(sourcemaps.write('./maps'))
.pipe(gulp.dest('./css'))
.pipe(browserSync.stream()) ;
}) ;
gulp.task('scripts', function() {
return gulp.src(['./src/js/modernizr-custom.js', './src/js/jquery.matchHeight.js', './src/js/main.js' ])
.pipe(concat('julieanne.js'))
.pipe(gulp.dest('./js'))
.pipe(uglify())
.pipe(rename('julieanne.min.js'))
.pipe(gulp.dest('./js')) ;
});
gulp.task('serve', function() {
browserSync({
proxy : 'http://julie',
open: false
});
gulp.watch("./js/**").on('change', browserSync.reload);
});
gulp.task('default', ['sass', 'scripts','watch', 'serve']) ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment