-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
75 lines (64 loc) · 1.85 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
var gulp = require('gulp');
var gulpNgConfig = require('gulp-ng-config');
var environments = require('gulp-environments');
var env_docker = environments.make("docker");
var env_cronos = environments.make("prd-cronos");
var ts = require('gulp-typescript');
ts.reporter.nullReporter()
var tsProject = ts.createProject('tsconfig.json');
var uglify = require('gulp-uglify');
gulp.task('default', function() {
// place code for your default task here
});
gulp.task('config:dev', function() {
gulp.src('configFile.json')
.pipe(gulpNgConfig('coordinatorentoolConfigs', {
environment: 'local'
}))
.pipe(gulp.dest('./app'));
});
gulp.task('config:prd', function() {
gulp.src('configFile.json')
.pipe(gulpNgConfig('coordinatorentoolConfigs', {
environment: 'production'
}))
.pipe(gulp.dest('./app'));
});
gulp.task('config:prd-cronos', function() {
gulp.src('configFile.json')
.pipe(gulpNgConfig('coordinatorentoolConfigs', {
environment: 'prd-cronos'
}))
.pipe(gulp.dest('./app'));
});
gulp.task('config:docker', function() {
gulp.src('configFile.json')
.pipe(gulpNgConfig('coordinatorentoolConfigs', {
environment: 'docker'
}))
.pipe(gulp.dest('./app'));
});
gulp.task('config', function() {
if (environments.production()) {
gulp.start('config:prd');
} else if (env_cronos()) {
gulp.start('config:prd-cronos');
} else if (env_docker()) {
gulp.start('config:docker');
} else {
gulp.start('config:dev');
}
});
gulp.task('tscompile', function() {
tsProject.src()
.pipe(ts(tsProject, undefined, ts.reporter.nullReporter()))
.js
.pipe(gulp.dest('.'));
});
gulp.task('uglify', function() {
if (environments.production()) {
gulp.src('app/*.js')
.pipe(uglify())
.pipe(gulp.dest('./app'));
}
});