-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
43 lines (36 loc) · 1.14 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
var gulp = require('gulp'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer');
var DEST = 'static/';
gulp.task('images', function() {
return gulp.src('ui/images/*')
.pipe(gulp.dest(DEST + '/images'));
});
gulp.task('scripts', function () {
return gulp.src([
'ui/js/helpers/*.js',
'ui/js/*.js',
])
.pipe(concat('custom.js'))
.pipe(gulp.dest(DEST + '/js'))
.pipe(rename({ suffix: '.min' }))
.pipe(uglify())
.pipe(gulp.dest(DEST + '/js'));
});
var compileSASS = function (filename, options) {
return sass('ui/scss/*.scss', options)
.pipe(autoprefixer('last 2 versions', '> 5%'))
.pipe(concat(filename))
.pipe(gulp.dest(DEST + '/css'));
};
gulp.task('sass', function () {
return compileSASS('custom.css', {});
});
gulp.task('sass-minify', function () {
return compileSASS('custom.min.css', { style: 'compressed' });
});
// Default Task
gulp.task('default', ['images', 'scripts', 'sass', 'sass-minify']);