forked from globocom/secDevLabs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
52 lines (43 loc) · 1.37 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
const gulp = require('gulp')
const uglifycss = require('gulp-uglifycss')
const uglify = require('gulp-uglify')
const babel = require('gulp-babel')
const htmlmin = require('gulp-htmlmin')
gulp.task('default', () => {
gulp.start('app')
})
gulp.task('app', ['app.html', 'app.css', 'app.js', 'deps.js', 'app.fonts', 'app.cursor', 'app.imgs'])
gulp.task('app.html', () => {
return gulp.src('src/assets/views/*.html')
.pipe(htmlmin({collapseWhitespace: true}))
.pipe(gulp.dest('src/public/views'))
})
gulp.task('app.css', () => {
return gulp.src('src/assets/css/*.css')
.pipe(uglifycss({"uglyComments": true}))
.pipe(gulp.dest('src/public/css'))
})
gulp.task('app.js', () => {
return gulp.src('src/assets/js/*.js')
.pipe(babel({
presets: ['@babel/preset-env']
}))
.pipe(uglify())
.pipe(gulp.dest('src/public/js'))
})
gulp.task('deps.js', () => {
return gulp.src('src/assets/js/external/*')
.pipe(gulp.dest('src/public/js/external'))
})
gulp.task('app.imgs', () => {
return gulp.src('src/assets/img/*.*')
.pipe(gulp.dest('src/public/img'))
})
gulp.task('app.cursor', () => {
return gulp.src('src/assets/cursors/*')
.pipe(gulp.dest('src/public/cursors'))
})
gulp.task('app.fonts', () => {
return gulp.src('src/assets/fonts/*')
.pipe(gulp.dest('src/public/fonts'))
})