Skip to content

Instantly share code, notes, and snippets.

@auniverseaway
Forked from joshperry/gulpfile.js
Created October 9, 2015 00:08
Show Gist options
  • Save auniverseaway/13b7fddcd7e3c8decc0a to your computer and use it in GitHub Desktop.
Save auniverseaway/13b7fddcd7e3c8decc0a to your computer and use it in GitHub Desktop.
var gulp = require('gulp');
var sass = require('gulp-sass');
var minifyCss = require('gulp-minify-css');
var sourceMaps = require('gulp-sourcemaps'),
path = require('path');
gulp.task('styles', function() {
gulp.src('./**/scss/*.scss', {base: '.'})
.pipe(sourceMaps.init())
.pipe(sass().on('error', sass.logError))
.pipe(rename(function (path) {
path.dirname += "/../css";
return path;
}))
.pipe(minifyCss())
.pipe(gulp.dest('.'))
});
//Watch task
gulp.task('default',function() {
gulp.watch('./**/scss/*.scss',['styles']);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment