-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
70 lines (52 loc) · 1.83 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
var gulp = require('gulp');
var appDev = 'assets/app/';
var appProd = 'public/js/app/';
var vendor = 'public/js/vendor';
/* JS & TS */
var jsuglify = require('gulp-uglify');
var typescript = require('gulp-typescript');
var sourcemaps = require('gulp-sourcemaps');
// Other
var concat = require('gulp-concat');
var tsProject = typescript.createProject('tsconfig.json');
gulp.task('build-ts', function () {
return gulp.src(appDev + '**/*.ts')
.pipe(sourcemaps.init())
.pipe(typescript(tsProject))
.pipe(sourcemaps.write())
// .pipe(jsuglify())
// .pipe(concat('bundle.js'))
.pipe(gulp.dest(appProd));
});
gulp.task('build-copy', function () {
return gulp.src([appDev + '**/*.html', appDev + '**/*.htm', appDev + '**/*.css'])
.pipe(gulp.dest(appProd));
});
gulp.task('vendor', function() {
// Angular 2 Scrollspy Framework
gulp.src('node_modules/ng2-scrollspy/**')
.pipe(gulp.dest(vendor + '/ng2-scrollspy'));
// Angular 2 Framework
gulp.src('node_modules/@angular/**')
.pipe(gulp.dest(vendor + '/@angular'));
//ES6 Shim
gulp.src('node_modules/es6-shim/**')
.pipe(gulp.dest(vendor + '/es6-shim/'));
//reflect metadata
gulp.src('node_modules/reflect-metadata/**')
.pipe(gulp.dest(vendor + '/reflect-metadata/'));
//rxjs
gulp.src('node_modules/rxjs/**')
.pipe(gulp.dest(vendor + '/rxjs/'));
//systemjs
gulp.src('node_modules/systemjs/**')
.pipe(gulp.dest(vendor + '/systemjs/'));
//zonejs
return gulp.src('node_modules/zone.js/**')
.pipe(gulp.dest(vendor + '/zone.js/'));
});
gulp.task('watch', function () {
gulp.watch(appDev + '**/*.ts', ['build-ts']);
gulp.watch(appDev + '**/*.{html,htm,css}', ['build-copy']);
});
gulp.task('default', ['watch', 'build-ts', 'build-copy']);