-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
43 lines (36 loc) · 1.23 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*-----------------------------------------------------------------
- Gulp for koochak
-----------------------------------------------------------------*/
// Plugins
var gulp = require('gulp'),
sass = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer'),
rename = require('gulp-rename'),
newer = require('gulp-newer'),
cssmin = require('gulp-cssmin'),
csscomb = require('gulp-csscomb');
// Source Folders
var source_dir = 'src/',
dist_dir = 'dist/'
css = {
in: source_dir + '**/*.scss',
out: dist_dir,
};
//------------------------------------------------------------
// Tasks
//------------------------------------------------------------
// Styles
gulp.task('styles', function() {
return gulp.src(css.in)
.pipe( sass().on('error', sass.logError) )
.pipe( autoprefixer("last 5 version") )
.pipe( csscomb() )
.pipe( gulp.dest(css.out) )
.pipe( rename({suffix: '.min'}) )
.pipe( cssmin() )
.pipe( gulp.dest( css.out ) );
});
// Default and Watch
gulp.task('default', ['styles'], function() {
gulp.watch( css.in , ['styles'] );
});