Last active
August 29, 2015 14:00
-
-
Save larswittenberg/11260218 to your computer and use it in GitHub Desktop.
Gulp Config
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
/******************************************************************************* | |
* DEPENDENCIES | |
*******************************************************************************/ | |
var gulp = require('gulp'); | |
var sass = require('gulp-sass'); | |
var notify = require('gulp-notify'); | |
var browserSync = require('browser-sync'); | |
/******************************************************************************* | |
* NOTIFY TASK | |
*******************************************************************************/ | |
function scssError(error){ | |
return "\n"+error.message+"\n"; | |
} | |
/******************************************************************************* | |
* SASS TASK | |
*******************************************************************************/ | |
gulp.task('sass', function () { | |
gulp.src('sass/styles.scss') | |
.pipe(sass({ | |
includePaths: ['scss'], | |
sourceComments: 'map' | |
}).on('error', notify.onError(scssError))) | |
.pipe(gulp.dest('css')); | |
}); | |
/******************************************************************************* | |
* BROWSERSYNC TASK | |
*******************************************************************************/ | |
gulp.task('browser-sync', function() { | |
browserSync.init(["css/*.css", "js/*.js", "application/views/**/*.tpl"]); | |
}); | |
/******************************************************************************* | |
* GULP DEFAULT | |
*******************************************************************************/ | |
gulp.task('default', ['sass', 'browser-sync'], function () { | |
gulp.watch("sass/**/*.scss", ['sass']); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment