-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgulpfile.js
42 lines (35 loc) · 960 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
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, done) {
exec('npm run app:prod --env.network=' + network, function(
err,
stdout,
stderr
) {
console.log(stdout);
console.log(stderr);
done(err);
});
}
gulp.task('clean', function(done) {
return del([config.releaseDirectory + '/*', config.releaseDirectory], done);
});
gulp.task('build-mainnet', ['clean'], function(done) {
buildApp('mainnet', done);
});
gulp.task('build-testnet', ['clean'], function(done) {
buildApp('testnet', done);
});
gulp.task('build-devnet', ['clean'], function(done) {
buildApp('devnet', done);
});