-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathgulpfile.js
42 lines (36 loc) · 1.05 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
const gulp = require('gulp')
const concat = require('gulp-concat')
const sourcemaps = require('gulp-sourcemaps')
const terser = require('gulp-terser')
const pipeline = require('readable-stream').pipeline
gulp.task('compress_js', function () {
return pipeline(
gulp.src(['src/js/js_variables.js', 'src/js/lang_mappings.js', 'src/js/html_holders.js', 'src/js/accessibility.js', 'src/js/GMap.js']),
sourcemaps.init(),
concat('all.js'),
terser(),
sourcemaps.write('.'),
// uglify(),
gulp.dest('public/js/')
)
})
const imagemin = require('gulp-imagemin')
gulp.task('compress_images', async function () {
gulp.src('src/img/*')
.pipe(imagemin())
.pipe(gulp.dest('public/img/'))
})
const gzip = require('gulp-gzip')
gulp.task('compress', function () {
gulp.src('./files/*')
.pipe(gzip())
.pipe(gulp.dest('data/'))
})
// const ejs = require('gulp-ejs')
// gulp.task('compress', function () {
// gulp.src('./templates/*.ejs')
// .pipe(ejs({
// msg: 'Hello Gulp!'
// }))
// .pipe(gulp.dest('./dist'))
// })