Created
August 4, 2015 15:14
-
-
Save sbeleidy/32ac64bad4208201a55e to your computer and use it in GitHub Desktop.
Foundation Gulpfile.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'), | |
uglify = require('gulp-uglify'), | |
sourcemaps = require('gulp-sourcemaps'), | |
sass = require('gulp-sass'), | |
imagemin = require('gulp-imagemin'), | |
plumber = require('gulp-plumber'), | |
browserSync = require('browser-sync'), | |
reload = browserSync.reload(); | |
gulp.task('uglify', function() { | |
return gulp.src('js/*.js') | |
.pipe(plumber()) | |
.pipe(uglify()) | |
.pipe(gulp.dest('assets/js')); | |
}); | |
gulp.task('sass', function() { | |
return gulp.src('scss/*.scss') | |
.pipe(plumber()) | |
.pipe(sourcemaps.init()) | |
.pipe(sass({ | |
outputStyle: 'compressed' | |
})) | |
.pipe(sourcemaps.write('/')) | |
.pipe(gulp.dest('assets/css')); | |
}); | |
gulp.task('imagemin', function() { | |
return gulp.src('img/*') | |
.pipe(plumber()) | |
.pipe(imagemin()) | |
.pipe(gulp.dest('assets/img')); | |
}); | |
gulp.task('browser-sync', function() { | |
browserSync({ | |
proxy: "localhost:8888" | |
}); | |
}); | |
gulp.task('watch', function() { | |
gulp.watch('scss/*.scss', ['sass', browserSync.reload]); | |
gulp.watch('js/*.js',['uglify', browserSync.reload]); | |
gulp.watch('index.html', [browserSync.reload]); | |
gulp.watch('img/*', ['imagemin']); | |
}); | |
gulp.task('default',['uglify', 'sass', 'browser-sync', 'watch']); |
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": { | |
"gulp": "~3.9.0", | |
"gulp-uglify": "~1.2.0", | |
"gulp-sass": "~2.0.4", | |
"gulp-imagemin": "~2.3.0", | |
"gulp-plumber": "~1.0.1", | |
"browser-sync": "~2.8.2", | |
"gulp-sourcemaps": "~1.5.2" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment