-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathgulpfile.js
More file actions
66 lines (61 loc) · 1.94 KB
/
gulpfile.js
File metadata and controls
66 lines (61 loc) · 1.94 KB
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
const gulp = require('gulp');
const del = require('del');
const typescript = require('gulp-typescript');
const sourcemaps = require('gulp-sourcemaps');
const shell = require("gulp-shell");
const tscConfig = require('./tsconfig.json');
// clean the contents of the distribution directory
gulp.task('clean', function () {
return del('dist/**/*');
});
gulp.task('compile', shell.task([
'npm run build'
]));
// copy dependencies
var ngPackageNames = [
'common',
'compiler',
'core',
'http',
'platform-browser',
'platform-browser-dynamic',
'router',
'router-deprecated',
'upgrade',
];
var depFiles = [];
ngPackageNames.forEach(function (p) {
depFiles.push('node_modules/@angular/' + p + '/' + p + '.umd.js');
});
depFiles = depFiles.concat([
'node_modules/core-js/client/shim.min.js',
'node_modules/zone.js/dist/zone.js',
'node_modules/reflect-metadata/Reflect.js',
'node_modules/systemjs/dist/system.src.js',
'node_modules/rxjs/**/*.js',
// // below for angular2-cookie
// 'node_modules/angular2-cookie/*.js',
// 'node_modules/angular2-cookie/services/*.js',
// 'node_modules/@angular/common/src/facade/lang.js',
// 'node_modules/@angular/platform-browser/src/dom/dom_adapter.js',
// 'node_modules/@angular/platform-browser/src/facade/lang.js',
// below for adal
'node_modules/adal-angular/**/*.js',
// below for angular2-adal
'node_modules/angular2-adal/**/*.js'
]);
gulp.task('copy:libs', ['clean'], function () {
return gulp.src(depFiles, { base: './node_modules' })
.pipe(gulp.dest('dist/lib'));
});
// copy static assets - i.e. non TypeScript compiled source
gulp.task('copy:assets', ['clean'], function () {
return gulp.src([
'src/**/*',
'!src/**/*.ts'
], { base: './src' })
.pipe(gulp.dest('dist'));
});
gulp.task('copy', ['copy:libs', 'copy:assets']);
gulp.task('build', ['compile', 'copy']);
gulp.task('default', ['build']);