This repository has been archived by the owner on Apr 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
103 lines (95 loc) · 2.02 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
99
100
101
102
103
var gulp = require('gulp'),
sass = require('gulp-sass')(require('node-sass')),
babel = require('gulp-babel'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
plumber = require('gulp-plumber')
gulp.task('sass-compiler', e => {
return gulp.src('./assets/sass/**/*.{scss, sass}')
.pipe(
sass.sync({
comments: false,
outputStyle: 'compressed'
}).on('error', sass.logError)
)
.pipe(gulp.dest('./assets/css/'))
})
gulp.task('app', e => {
return gulp.src(['./assets/js/app/**/*.js'])
.pipe(plumber())
.pipe(babel({
compact: false,
presets: ['@babel/env']
}))
.pipe(uglify())
.pipe(concat('app.js'))
.pipe(uglify())
.pipe(gulp.dest('./assets/js/'))
})
gulp.task('engine', e => {
return gulp.src(['./assets/js/engine/**/*.js'])
.pipe(plumber())
.pipe(babel({
compact: false,
presets: ['@babel/env']
}))
.pipe(uglify())
.pipe(concat('engine.js'))
.pipe(uglify())
.pipe(gulp.dest('./assets/js/'))
})
gulp.task('plugins', e => {
return gulp.src(['./assets/js/plugins/**/*.js'])
.pipe(plumber())
.pipe(babel({
compact: false,
presets: ['@babel/env']
}))
.pipe(uglify())
.pipe(concat('plugins.js'))
.pipe(uglify())
.pipe(gulp.dest('./assets/js/'))
})
gulp.task('gui', e => {
return gulp.src(['./assets/js/gui/**/*.js'])
.pipe(plumber())
.pipe(babel({
compact: false,
presets: ['@babel/env']
}))
.pipe(uglify())
.pipe(concat('gui.js'))
.pipe(uglify())
.pipe(gulp.dest('./assets/js/'))
})
gulp.task('splash', e => {
return gulp.src(['./assets/js/splash/**/*.js'])
.pipe(plumber())
.pipe(babel({
compact: false,
presets: ['@babel/env']
}))
.pipe(uglify())
.pipe(concat('splash.js'))
.pipe(uglify())
.pipe(gulp.dest('./assets/js/'))
})
gulp.task('sass', e => {
gulp.watch([
'assets/sass/**/*.{scss, sass}'
], gulp.parallel([
'sass-compiler'
]))
})
gulp.task('js', e => {
gulp.watch([
'assets/js/**/*.js',
'!assets/js/apis/**/*.js'
], gulp.parallel([
'app',
'engine',
'plugins',
'gui',
'splash'
]))
})