-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
93 lines (81 loc) · 2.18 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
'use strict';
const gulp = require('gulp');
const babel = require('gulp-babel');
const cssnano = require('gulp-cssnano');
const sourcemaps = require('gulp-sourcemaps');
const imagemin = require('gulp-imagemin');
const autoprefixer = require('gulp-autoprefixer');
const plumber = require("gulp-plumber");
gulp.task('babel', () =>
gulp
.src('src/js/**/*.js')
.pipe(
babel({
presets: ['@babel/env']
})
)
.pipe(gulp.dest('public/js/'))
);
gulp.task('workflow', () => {
return gulp.src('./src/stylesheets/**/*.css')
.pipe(plumber())
.pipe(gulp.dest('./public/stylesheets/'));
});
gulp.task('copyfonts', () =>
gulp
.src('./src/stylesheets/util/*.{ttf,woff,eof,svg}')
.pipe(gulp.dest('./public/stylesheets/util'))
);
gulp.task('moveFavicon', () =>
gulp.src('src/favicon/**.*').pipe(gulp.dest('public/favicon/'))
);
gulp.task('imagemin', () => {
return gulp.src('./src/assets/images/*')
.pipe(imagemin())
.pipe(gulp.dest('./public/assets/images'));
});
gulp.task('moveJSVendor', () => {
return gulp.src('src/js-vendor/*').pipe(gulp.dest('public/'));
});
gulp.task('moveAudio', () => {
return gulp.src('src/assets/audio/*').pipe(gulp.dest('public/assets/audio'));
});
gulp.task(
'default',
gulp.series(
'workflow',
'babel',
'copyfonts',
'moveFavicon',
'imagemin',
'moveJSVendor',
'moveAudio',
(done) => {
gulp.watch('src/stylesheets/**/*.scss', gulp.series('workflow'));
gulp.watch('./src/js/**/*.js', gulp.series('babel'));
done();
}
)
);
gulp.task('dev', gulp.series('workflow', 'babel', (done) => {
gulp.watch('src/stylesheets/**/*.scss', gulp.series('workflow'));
gulp.watch('./src/js/**/*.js', gulp.series('babel'));
done();
}
)
);
gulp.task(
'build',
gulp.series(
'workflow',
'babel',
'copyfonts',
'moveFavicon',
'imagemin',
'moveJSVendor',
'moveAudio',
() => {
console.log('Application ready! God speed!');
}
)
);