Skip to content

Instantly share code, notes, and snippets.

@joshperry
Forked from auniverseaway/gulpfile.js
Last active October 9, 2015 00:08
Show Gist options
  • Save joshperry/18249b471ee006e68896 to your computer and use it in GitHub Desktop.
Save joshperry/18249b471ee006e68896 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() {
var designBase = 'src/main/resources/jcr_root/etc/slick/designs/';
gulp.src('**/scss/*.scss', { base: designBase })
.pipe(sourceMaps.init())
.pipe(sass().on('error', sass.logError))
.pipe(minifyCss())
.pipe(rename(function(path){
var newPath = path.join(path.dirname(path), '../css', path.basename(path));
console.log('rename %s to %s', path, newPath);
return newPath;
}))
.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