From 02dd7cd08afcbbc5610dc0d8c2aa91893d3f632d Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 4 Jan 2016 17:11:19 +0000 Subject: [PATCH] Move paths into a config variable --- gulpfile.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 38e6c5b2..0ea83270 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -3,25 +3,31 @@ var gulp = require('gulp'), plugins = require('gulp-load-plugins')(); +var config = { + cssDir: './source/assets/css', + imagesDir: './source/assets/images', + sassPattern: './sass/**/*.scss' +}; + gulp.task('compass', function () { gulp.src('./sass') .pipe(plugins.compass({ config_file: './config.rb', - css: './source/assets/css' + css: config.cssDir })) .pipe(plugins.minifyCss()) - .pipe(gulp.dest('./source/assets/css')); + .pipe(gulp.dest(config.cssDir)); }); gulp.task('image', function () { // Minify images. - gulp.src('./source/assets/images/*') + gulp.src(imagesDir + '/*') .pipe(plugins.imagemin()) - .pipe(gulp.dest('./source/assets/images')); + .pipe(gulp.dest(config.imagesDir)); }); gulp.task('watch', function () { - gulp.watch('./sass/**/*.scss', ['compass']); + gulp.watch(config.sassPattern, ['compass']); }); gulp.task('default', ['watch']);