-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
50 lines (43 loc) · 1.32 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
50
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass'),
concat = require('gulp-concat'),
uncss = require('gulp-uncss'),
minifyCss = require('gulp-minify-css');
// Compile sass files.
gulp.task('sass', function () {
return gulp.src('style/sass/all.sass')
.pipe(sass({indentedSyntax: true,
errLogToConsole: true
}))
.pipe(gulp.dest('style/css/'));
});
gulp.task('uncss', ['sass'], function () {
return gulp.src('style/css/all.css')
.pipe(minifyCss({
keepSpecialComments: 0
}))
.pipe(uncss({
html: ['index.html',
'menu/**/*.html',
'about/**/*html',
]
}))
.pipe(gulp.dest('build/style/css/'));
});
gulp.task('movePlugins', function () {
return gulp.src('node_modules/jquery-smooth-scroll/jquery.smooth-scroll.min.js')
.pipe(gulp.dest('js/plugins/'));
});
// Concat javasript.
gulp.task('js', function () {
return gulp.src(['js/plugins/*.js', 'js/*.js'])
.pipe(concat('all.js'))
.pipe(gulp.dest('js/all/'));
});
// Watch for changes.
gulp.task('watch', function () {
gulp.watch('style/sass/*.sass', ['uncss']);
gulp.watch('js/**/*.js', ['js']);
});
gulp.task('default', ['movePlugins', 'uncss', 'js', 'watch']);