Created
February 6, 2015 08:35
-
-
Save wayanjimmy/4f6da924c7f1c7116124 to your computer and use it in GitHub Desktop.
generic gulpfile.js
This file contains hidden or 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 less = require('gulp-less'); | |
var notify = require('gulp-notify'); | |
var gutil = require('gulp-util'); | |
var browserSync = require('browser-sync'); | |
gulp.task('less', function(){ | |
return gulp.src(['./less/main.less']) | |
.pipe(less({ compress:true }).on('error', gutil.log)) | |
.pipe(gulp.dest('./css')) | |
.pipe(notify('Less Compiled, Prefixed and Minified')); | |
}); | |
gulp.task('browser-sync', function() { | |
var files = [ | |
'index.html', | |
'css/main.css' | |
]; | |
browserSync.init(files, { | |
server: { | |
baseDir: './' | |
} | |
}); | |
}); | |
gulp.task('default', function(){ | |
gulp.start('less'); | |
gulp.start('browser-sync'); | |
gulp.watch('./less/*.less', function(){ | |
gulp.start('less'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment