-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
59 lines (51 loc) · 2.48 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
/**
* Created by Maxi- PC on 24.11.2016.
*/
var gulp = require('gulp');
var rename = require('gulp-rename');
var clean = require('gulp-clean');
var exec = require('child_process').execSync;
var ts = require('gulp-typescript');
var install = require('gulp-install');
gulp.task('compile-client', function () {
exec('"ksn_client/node_modules/.bin/ngc" -p ksn_client/tsconfig-aot.json', function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
console.log(err);
});
});
gulp.task('shake-client', ['compile-client'], function () {
exec('"ksn_client/node_modules/.bin/rollup" -c ksn_client/rollup-config.js', function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
console.log(err);
});
});
gulp.task('build-client', ['shake-client'], function () {
gulp.src('ksn_client/index-aot.html').pipe(rename('index.html')).pipe(gulp.dest('ksn_dist/ksn_client'));
gulp.src(['ksn_client/node_modules/zone.js/dist/zone.min.js',
'ksn_client/node_modules/core-js/client/shim.min.js',
'ksn_client/node_modules/moment/min/moment.min.js',
'ksn_client/node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js',
'ksn_client/node_modules/bootstrap-datepicker/dist/locales/bootstrap-datepicker.de.min.js',
'ksn_client/bootstrap3.3.7/js/bootstrap.min.js',
'ksn_client/node_modules/jquery/dist/jquery.min.js',
'ksn_client/aot/dist/build.js']).pipe(gulp.dest('ksn_dist/ksn_client/js'));
gulp.src(['ksn_client/node_modules/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css',
'ksn_client/styles.css',
'ksn_client/bootstrap3.3.7/css/bootstrap.min.css']).pipe(gulp.dest('ksn_dist/ksn_client/css'));
gulp.src(['ksn_client/bootstrap3.3.7/fonts/*']).pipe(gulp.dest('ksn_dist/ksn_client/fonts'));
});
gulp.task('compile-server', function () {
var tsProject = ts.createProject('ksn_server/tsconfig.json');
gulp.src("ksn_server/src/**/*.ts").pipe(tsProject()).js.pipe(gulp.dest("ksn_dist/ksn_server/bin"));
});
gulp.task('build-server', ['compile-server'] , function () {
gulp.src("ksn_server/bin/www").pipe(gulp.dest("ksn_dist/ksn_server/bin"));
gulp.src("ksn_server/package.json").pipe(gulp.dest("ksn_dist/ksn_server")).pipe(install({production : true}));
});
gulp.task('build', ['build-client', 'build-server'], function () {
});
gulp.task('clean', function () {
gulp.src(['ksn_client/aot', 'ksn_dist'], {read: false}).pipe(clean());
});