-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
58 lines (55 loc) · 1.45 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
var gulp = require('gulp'),
gt = require('gulp-load-plugins')(),
rollup = require('rollup-stream'),
babel = require('gulp-babel'),
source = require('vinyl-source-stream'),
buffer = require('vinyl-buffer');
const autoprefixer = require('gulp-autoprefixer');
var deploy = require('gulp-gh-pages');
gulp.task('pug', function () {
return gulp
.src('src/pug/*.pug')
.pipe(
gt.pug({
pretty: true,
})
)
.pipe(gulp.dest('assets'));
});
gulp.task('deploy', function () {
return gulp.src('./assets/**/*').pipe(deploy());
});
gulp.task('js', function () {
return rollup({
input: './src/static/js/script.js',
format: 'iife',
})
.pipe(source('script.js'))
.pipe(buffer())
.pipe(babel())
.pipe(gulp.dest('assets/js'));
});
gulp.task('image', function () {
return gulp
.src(['src/static/img/*', 'src/static/img/**/*'])
.pipe(gulp.dest('assets/img'));
});
gulp.task('fonts', function () {
return gulp.src(['src/static/fonts/*']).pipe(gulp.dest('assets/fonts'));
});
gulp.task('scss', function () {
return gulp
.src('src/static/scss/*.scss')
.pipe(
gt.sass({
outputStyle: 'nested',
})
)
.pipe(
autoprefixer(['last 15 versions', '> 1%', 'ie 8', 'ie 7'], {
cascade: true,
})
)
.pipe(gulp.dest('assets/css'));
});
gulp.task('default', gulp.series('pug', 'js', 'scss', 'image', 'fonts'));