-
Notifications
You must be signed in to change notification settings - Fork 19
/
gulpfile.js
81 lines (72 loc) · 2.06 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
var gulp = require('gulp');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var minifyCSS = require('gulp-minify-css');
var rename = require('gulp-rename');
var connect = require('gulp-connect');
var autoprefixer = require('gulp-autoprefixer');
var ghPages = require('gulp-gh-pages');
gulp.task('sass', function() {
return gulp.src('sass/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(gulp.dest('css'));
});
gulp.task('styles', ['fonts', 'sass'], function() {
return gulp.src([
'bower_components/normalize.css/normalize.css',
'bower_components/font-awesome/css/font-awesome.css',
'bower_components/minimal-devices/css/*.css',
'css/main.css'
])
.pipe(concat('all.css'))
.pipe(rename('all.min.css'))
.pipe(minifyCSS())
.pipe(gulp.dest('css'))
.pipe(connect.reload());
});
gulp.task('fonts', function() {
gulp.src('bower_components/font-awesome/fonts/*')
.pipe(gulp.dest('fonts'));
});
gulp.task('scripts', function() {
return gulp.src([
'bower_components/tweenlite/TweenLite.min.js',
'bower_components/gsap/src/minified/easing/EasePack.min.js',
'scripts/rAF.js',
'scripts/**/*.js'
])
.pipe(concat('all.js'))
.pipe(rename('all.min.js'))
.pipe(uglify())
.pipe(gulp.dest('js'))
.pipe(connect.reload());
});
gulp.task('html', function() {
gulp.src('index.html')
.pipe(connect.reload());
});
gulp.task('watch', function() {
gulp.watch('index.html', ['html']);
gulp.watch('scripts/**/*.js', ['scripts']);
gulp.watch('sass/**/*.scss', ['styles']);
});
gulp.task('connect', function() {
connect.server({ livereload: true });
});
gulp.task('deploy', ['scripts', 'styles'], function() {
gulp.src([
'js/all.min.js',
'css/all.min.css',
'img/*',
'fonts/*',
'index.html',
'favicon.ico'
], { base: './' })
.pipe(ghPages());
});
gulp.task('default', ['connect', 'watch', 'scripts', 'styles']);