2016-01-04 11:36:14 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var gulp = require('gulp'),
|
2016-01-04 17:07:01 +00:00
|
|
|
plugins = require('gulp-load-plugins')();
|
2016-01-04 11:36:14 +00:00
|
|
|
|
2016-01-04 17:11:19 +00:00
|
|
|
var config = {
|
|
|
|
cssDir: './source/assets/css',
|
|
|
|
imagesDir: './source/assets/images',
|
|
|
|
sassPattern: './sass/**/*.scss'
|
|
|
|
};
|
|
|
|
|
2016-01-04 12:20:00 +00:00
|
|
|
gulp.task('compass', function () {
|
|
|
|
gulp.src('./sass')
|
2016-01-04 17:07:01 +00:00
|
|
|
.pipe(plugins.compass({
|
2016-01-04 12:20:00 +00:00
|
|
|
config_file: './config.rb',
|
2016-01-04 17:11:19 +00:00
|
|
|
css: config.cssDir
|
2016-01-04 12:20:00 +00:00
|
|
|
}))
|
2016-01-04 17:07:01 +00:00
|
|
|
.pipe(plugins.minifyCss())
|
2016-01-04 17:11:19 +00:00
|
|
|
.pipe(gulp.dest(config.cssDir));
|
2016-01-04 12:20:00 +00:00
|
|
|
});
|
|
|
|
|
2016-01-04 11:36:14 +00:00
|
|
|
gulp.task('image', function () {
|
2016-01-04 11:38:34 +00:00
|
|
|
// Minify images.
|
2016-01-04 17:11:19 +00:00
|
|
|
gulp.src(imagesDir + '/*')
|
2016-01-04 17:07:01 +00:00
|
|
|
.pipe(plugins.imagemin())
|
2016-01-04 17:11:19 +00:00
|
|
|
.pipe(gulp.dest(config.imagesDir));
|
2016-01-04 11:36:14 +00:00
|
|
|
});
|
|
|
|
|
2016-01-04 12:20:00 +00:00
|
|
|
gulp.task('watch', function () {
|
2016-01-04 17:11:19 +00:00
|
|
|
gulp.watch(config.sassPattern, ['compass']);
|
2016-01-04 12:20:00 +00:00
|
|
|
});
|
|
|
|
|
2016-01-04 13:25:16 +00:00
|
|
|
gulp.task('default', ['watch']);
|