forked from InfomediaLtd/ag-grid-ng2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
50 lines (41 loc) · 1.41 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
const headerTemplate = '// <%= pkg.name %> v<%= pkg.version %>\n';
const gulp = require('gulp');
const header = require('gulp-header');
const pkg = require('./package.json');
const del = require('del');
const ngc = require('gulp-ngc');
const runSequence = require('run-sequence');
gulp.task('clean', function () {
return del(['aot/**', '!aot',
'dist/**', '!dist',
'./main.metadata.json', './main.js*', './main.d.ts']);
});
/*
* ngc compilation tasks
*/
gulp.task('clean-ngc', (callback) => {
return runSequence('clean', 'ngc', callback);
});
gulp.task('ngc', (callback) => {
return runSequence('ngc-src', 'ngc-main', callback)
});
gulp.task('ngc-src', (callback) => {
return ngc('./tsconfig-src.json', callback);
});
gulp.task('ngc-main', (callback) => {
return ngc('./tsconfig-main.json', callback);
});
// the main release task - clean, compile and add header template
gulp.task('release', ['clean-ngc'], function () {
require('./agGridPropertiesCheck');
gulp.src(['./dist/', '!./dist/**/*.metadata.json'])
.pipe(header(headerTemplate, {pkg: pkg}))
.pipe(gulp.dest('./dist/'));
});
gulp.task('watch', ['clean-ngc'], () => {
gulp.watch([
'./node_modules/ag-grid/dist/**/*', './node_modules/ag-grid/main.js',
'./node_modules/ag-grid-enterprise/dist/**/*', './node_modules/ag-grid-enterprise/main.js',
'./src/**/*'
], ['clean-ngc']);
});