-
Notifications
You must be signed in to change notification settings - Fork 75
/
Copy pathgulpfile.js
46 lines (41 loc) · 982 Bytes
/
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
const gulp = require('gulp');
const zip = require('gulp-zip');
const clean = require('gulp-clean');
const moment = require('dayjs');
const rename = require('gulp-rename');
const runSequence = require('run-sequence')
var argv = require('yargs').argv;
var env = argv.env || 'dev';
gulp.task('zip', () => {
return gulp.src([
'./server/**/*', './package.json'
])
.pipe(zip(moment().format("YYYY-MM-DD") + '-www.zip'))
.pipe(gulp.dest("dist"));
})
gulp.task('build:public', () => {
return gulp.src(['./dist/**'])
.pipe(gulp.dest('./server/public'));
});
gulp.task('build:cleanMap', () => {
gulp.src(['./dist/**'])
.pipe(clean({
force: true
}))
})
gulp.task('build:clean', () => {
gulp.src(
[
'./.env', './server/public/**'
], {
read: false
})
.pipe(clean({
force: true
}));
});
gulp.task('build', function () {
runSequence(
'zip'
)
});