-
Notifications
You must be signed in to change notification settings - Fork 6
/
gulpfile.js
35 lines (30 loc) · 994 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
const {src, dest, series} = require('gulp');
const zip = require('gulp-zip');
const del = require('del');
const pkgJson = require('./package.json');
const jeditor = require("gulp-json-editor");
function clean() {
del(['dist']);
return updateManifest();
}
function updateManifest() {
return src('./package.json')
.pipe(jeditor(function(json){
json.c8y.application.version = pkgJson.version;
return json;
}))
.pipe(dest('./'));
}
const bundle = series(
function createZip() {
return src('./dist/apps/app-builder/**/*')
.pipe(zip(`${pkgJson.name}-${pkgJson.version}.zip`))
.pipe(dest('dist/'))
}
)
exports.clean = clean;
exports.bundle = bundle;
exports.default = series(bundle, async function success() {
console.log("Build Finished Successfully!");
console.log(`App Builder zip Output (Install in the browser): dist/${pkgJson.name}-${pkgJson.version}.zip`);
});