Last active
October 22, 2015 06:07
-
-
Save isnifer/04311945252afc9d7fc8 to your computer and use it in GitHub Desktop.
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 autoprefixer = require('gulp-autoprefixer'); | |
var browserSync = require('browser-sync').create(); | |
gulp.task('css', function () { | |
return gulp.src('less/main.less') | |
.pipe(less()) | |
// THIS FCKING SOLUTION! FCK YEAH! | |
.on('error', function (e) { | |
console.log(e.message); | |
this.emit('end'); | |
}) | |
.pipe(autoprefixer({ | |
browsers: ['last 2 versions'], | |
cascade: false | |
})) | |
.pipe(gulp.dest('./css')) | |
.pipe(browserSync.stream()); | |
}); | |
// Static server | |
gulp.task('serve', function() { | |
browserSync.init({ | |
server: { | |
baseDir: './' | |
} | |
}); | |
gulp.watch('*.html').on('change', browserSync.reload); | |
gulp.watch('less/*.less', ['css']); | |
}); | |
gulp.task('default', ['serve']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment