-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
52 lines (46 loc) · 1.01 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
/* eslint-disable */
'use strict';
var gulp = require('gulp');
var order = require('gulp-order');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var del = require('del');
var ghPages = require('gh-pages');
gulp.task('js', function () {
return gulp.src('source/js/modules/**/*.js')
.pipe(order([
'!main.js',
'*.js'
]))
.pipe(concat('app.js'))
.pipe(uglify())
.pipe(rename(function (path) {
path.basename += '.min';
}))
.pipe(gulp.dest('build/js'));
});
gulp.task('copy', function () {
return gulp.src([
'source/css/**',
'source/fonts/**/*.{woff,woff2}',
'source/img/**',
'source/photos/**',
'source/favicon.ico',
'source/index.html'
], {
base: 'source'
})
.pipe(gulp.dest('build'));
});
gulp.task('clean', function () {
return del('build');
});
gulp.task('build', gulp.series(
'clean',
'copy',
'js'
));
gulp.task('deploy', function (cb) {
ghPages.publish('build',cb);
});