forked from wavesplatform/WavesExplorerLite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
45 lines (37 loc) · 1.07 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
44
45
const gulp = require('gulp');
const del = require('del');
const fs = require('fs');
var exec = require('child_process').exec;
const config = {
package: {
source: './package.json'
},
baseDir: 'src',
releaseDirectory: 'dist'
};
config.package.data = JSON.parse(fs.readFileSync(config.package.source));
function buildApp(network, env, done) {
exec('yarn run build:' + env + ' --env.network=' + network, function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
done(err);
})
}
function clean() {
return del([
config.releaseDirectory + '/*',
config.releaseDirectory
]);
}
function buildOfficialProd(done) {
buildApp('mainnet', 'prod', done);
}
function buildOfficialStaging(done) {
buildApp('mainnet', 'dev', done);
}
function buildDevnet(done) {
buildApp('devnet', 'prod', done);
}
exports.buildOfficialProd = gulp.series(clean, buildOfficialProd);
exports.buildOfficialStaging = gulp.series(clean, buildOfficialStaging);
exports.buildDevnet = gulp.series(clean, buildDevnet);