-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
63 lines (55 loc) · 1.43 KB
/
Copy pathgulpfile.js
File metadata and controls
63 lines (55 loc) · 1.43 KB
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
var gulp = require('gulp'),
sass = require('gulp-sass'),
minifyCSS = require('gulp-minify-css'),
prefixer = require('gulp-autoprefixer'),
ghPages = require('gulp-gh-pages-cname'),
img = require('gulp-imagemin'),
minifyHTML = require('gulp-minify-html'),
connect = require('gulp-connect')
gulp.task('default', ['styles', 'img', 'html', 'fonts'])
gulp.task('styles', function () {
return gulp
.src('./source/sass/**/*.sass')
.pipe(sass({
indentedSyntax: true
}))
.pipe(prefixer())
.pipe(minifyCSS())
.pipe(gulp.dest('./build/assets/css/'))
})
gulp.task('html', function() {
return gulp
.src('./source/html/*')
.pipe(minifyHTML())
.pipe(gulp.dest('./build/'))
})
gulp.task('img', function() {
return gulp
.src('./source/img/**/*')
.pipe(img())
.pipe(gulp.dest('./build/assets/img/'))
})
gulp.task('fonts', function() {
return gulp
.src('./source/fonts/**/*')
.pipe(gulp.dest('./build/assets/fonts/'))
})
gulp.task ('deploy', ['default'], function() {
return gulp
.src('./build/**/*')
.pipe(ghPages({
branch: 'master',
cname: 'kraiom.com'
}))
})
gulp.task('watch', ['default'], function () {
gulp.watch('./source/js/**/*', ['scripts'])
gulp.watch('./source/sass/**/*', ['styles'])
gulp.watch('./source/html/*', ['html'])
})
gulp.task('serve', ['watch'], function () {
connect.server({
root: './build/',
livereload: true
})
})