-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
31 lines (25 loc) · 723 Bytes
/
gulpfile.js
File metadata and controls
31 lines (25 loc) · 723 Bytes
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
const gulp = require('gulp');
const del = require('del');
const terser = require('gulp-terser');
const cleanCss = require('gulp-clean-css');
const SRC_DIR = "src";
const PACKAGE_DIR = "docs";
function clean() {
return del(PACKAGE_DIR + "/**", {force:true});
}
function compressJs() {
return gulp.src(SRC_DIR + '/*.js')
.pipe(terser())
.pipe(gulp.dest(PACKAGE_DIR + '/'));
}
function compressCss() {
return gulp.src(SRC_DIR + '/*.css')
.pipe(cleanCss())
.pipe(gulp.dest(PACKAGE_DIR + '/'));
}
function copyHtml() {
return gulp.src(SRC_DIR + '/**/*.html')
.pipe(gulp.dest(PACKAGE_DIR + '/'));
}
exports.package = gulp.parallel(compressJs,compressCss,copyHtml);
exports.clean = clean;