-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
41 lines (38 loc) · 1.09 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
const pack = "build";
gulp = require("gulp"),
less = require("gulp-less"),
cleanCSS = require('gulp-clean-css'),
cleanJS = require('gulp-uglify'),
del = require("del"),
concat = require('gulp-concat'),
babel = require('gulp-babel'),
clean = () => del([pack]),
pug = require('gulp-pug'),
uglify = require('gulp-uglify');
const bin = () => {
return gulp.src("bin/*.js")
.pipe(babel()).pipe(cleanJS())
.pipe(gulp.dest(`${pack}/bin`));
}
const data = () => {
return gulp.src('public/lib/*.json')
.pipe(gulp.dest(`${pack}/public/lib`));
}
const pics = () => {
return gulp.src("public/images/*.*")
.pipe(gulp.dest(`${pack}/public/images`))
}
const script = () =>{
return gulp.src("public/javascripts/*.*")
.pipe(babel())
.pipe(cleanJS())
.pipe(gulp.dest(`${pack}/public/javascripts`))
}
const views = () => {
return gulp.src("views/*.pug")
.pipe(gulp.dest(`${pack}/views`))
}
gulp.task("copy", gulp.parallel(bin, data, pics,
script, views));
gulp.task("default", gulp.series(clean, "copy"));
gulp.task("clean", clean);