-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
98 lines (84 loc) · 3.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
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
var gulp = require('gulp')
, coffee = require('gulp-coffee')
, stylus = require('gulp-stylus')
, imagemin = require('gulp-imagemin')
, pug = require('gulp-pug')
, prefix = require('gulp-autoprefixer')
, concat = require('gulp-concat')
, deploy = require('gulp-gh-pages')
, order = require('gulp-order')
, copy = require('recursive-copy')
, dirs = {
'source': {
examples: './developer/examples'
, example: './developer/examples/**'
, coffee: './developer/coffee/**/*.coffee'
, js: './developer/js/**/*.js'
, fonts: './developer/fonts/**'
, images: './developer/images/**'
, stylus: './developer/styl/**/*'
, jade: './developer/*.jade'
}
, 'build': {
examples: './docs/examples'
, css: './docs/css/'
, images: './docs/images/'
, js: './docs/js/'
, fonts: './docs/fonts/'
, html: './docs/'
}
};
gulp.task('stylus', function () {
return gulp.src(dirs.source.stylus)
.pipe(stylus())
.pipe(prefix())
.pipe(order(["reset.css", "fonts.css", "default.css", "slidster.css", "slides.css"]))
.pipe(concat('styles.css'))
.pipe(gulp.dest(dirs.build.css));
});
gulp.task('jade', function () {
return gulp.src(dirs.source.jade)
.pipe(pug({}))
.pipe(gulp.dest(dirs.build.html));
});
gulp.task('fonts', function () {
return gulp.src(dirs.source.fonts)
.pipe(gulp.dest(dirs.build.fonts));
});
gulp.task('js', function () {
return gulp.src(dirs.source.js)
.pipe(gulp.dest(dirs.build.js));
});
gulp.task('coffee', function () {
return gulp.src(dirs.source.coffee)
.pipe(coffee())
.pipe(gulp.dest(dirs.build.js));
});
gulp.task('examples', function () {
copy(dirs.source.examples, dirs.build.examples);
});
gulp.task('images', function () {
return gulp.src(dirs.source.images)
// .pipe(imagemin())
.pipe(gulp.dest(dirs.build.images));
});
gulp.task('watch', function () {
gulp.watch(dirs.source.example, ['examples']);
gulp.watch(dirs.source.coffee, ['coffee']);
gulp.watch(dirs.source.js, ['js']);
gulp.watch(dirs.source.images, ['images']);
gulp.watch(dirs.source.jade, ['jade']);
gulp.watch(dirs.source.stylus, ['stylus']);
});
gulp.task('deploy', function () {
console.log('deploying');
return gulp.src('build/**')
.pipe(deploy({
cacheDir: 'gh-cache',
remoteUrl: 'https://github.com/SilentImp/codeStyleAndViolenceRu.git'
}).on('error', function(){
console.log('error', arguments);
}));
});
gulp.task('build', ['stylus','jade', 'js', 'fonts', 'coffee', 'images']);
gulp.task('default', ['build', 'watch']);