-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathgulpfile.js
49 lines (43 loc) · 1.07 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
44
45
46
47
48
49
var gulp = require('gulp');
var sass = require('gulp-ruby-sass');
var prefix = require('gulp-autoprefixer');
var minify = require('gulp-minify-css');
var rename = require('gulp-rename');
var util = require('gulp-util');
var size = require('gulp-size');
var uglify = require('gulp-uglifyjs');
gulp.task('styles', function () {
return gulp.src([
'scss/*.scss'
])
.pipe(sass({
precision: 10
}))
.pipe(prefix('last 2 versions', 'ie 8'))
.pipe(minify({ keepSpecialComments: 1 }))
.pipe(size({
showFiles: true,
gzip: true,
title: 'Styles'
}))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('css'));
});
gulp.task('scripts', function() {
return gulp.src([
'js/*.js',
'!js/*.min.js'
])
.pipe(uglify())
.pipe(size({
gzip: true,
title: 'Scripts'
}))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('js'));
});
gulp.task('watch', function () {
gulp.watch('scss/**/*.scss', ['styles']);
gulp.watch('js/**/*.js', ['scripts']);
});
gulp.task('default', ['styles', 'scripts']);