Skip to content

Instantly share code, notes, and snippets.

@fenbox
Created December 29, 2013 11:48
Show Gist options
  • Star 18 You must be signed in to star a gist
  • Fork 10 You must be signed in to fork a gist
  • Save fenbox/8169603 to your computer and use it in GitHub Desktop.
Save fenbox/8169603 to your computer and use it in GitHub Desktop.
sample gulp config: gulpfile.js
// Include gulp
var gulp = require('gulp');
// Include Our Plugins
var sass = require('gulp-sass');
var lr = require('tiny-lr'),
refresh = require('gulp-livereload'),
server = lr();
// Task SASS
gulp.task('sass', function() {
gulp.src([
'scss/**/*.scss',
'!scss/**/_*.scss'
])
.pipe(sass({
includePaths: ['scss']
}))
.pipe(gulp.dest('css'))
.pipe(refresh(server));
});
gulp.task('refresh', function() {
gulp.src([
'**/*.html',
'**/*.php'
])
.pipe(refresh(server));
});
// Task: default
gulp.task('default', function() {
gulp.run('sass');
server.listen(35729, function (error) {
if (error) return console.log(error);
gulp.watch([
'scss/**',
'img/**'
], function(event) {
gulp.run('sass');
});
gulp.watch([
'**/*.html',
'**.php'
], function(event) {
gulp.run('refresh');
});
});
});
@Mickey-
Copy link

Mickey- commented Jan 4, 2014

thanks for sharing~

@ZpCooper
Copy link

thanks for sharing~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment