Move paths into a config variable
This commit is contained in:
parent
5f53a1d6a1
commit
02dd7cd08a
16
gulpfile.js
16
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']);
|
||||
|
|
Reference in a new issue