-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
43 lines (38 loc) · 1.13 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
const {src, dest, series} = require("gulp");
const zip = require("gulp-zip");
const modifyFile = require('gulp-modify-file');
const jsonModify = require('gulp-json-modify')
const path = require('path')
function zipRequest() {
return src([
'./ViewerRequest/**/*.js',
'!./ViewerRequest/node_modules/**',
'!./ViewerRequest/test/**'
])
.pipe(zip('ViewerRequest.zip'))
.pipe(dest('./dist'));
}
function zipResponse() {
return src([
'./ViewerResponse/**/*.js',
'!./ViewerResponse/node_modules/**',
'!./ViewerResponse/test/**'
])
.pipe(zip('ViewerResponse.zip'))
.pipe(dest('./dist'));
}
function prepare() {
return src([
'ViewerRequest/sdk/*.js'
])
.pipe(dest('dist/ViewerRequest/sdk'));
}
exports.stripPackage = () => {
return src(['./package.json'])
.pipe(jsonModify({key: 'devDependencies', value: {}}))
.pipe(jsonModify({key: 'scripts', value: {}}))
.pipe(dest('./'))
}
exports.prepare = prepare;
exports.buildArtifacts = series(prepare, zipRequest, zipResponse);
exports.default = exports.buildArtifacts;