Skip to content

Commit 6416e79

Browse files
vicbjasonaden
authored andcommitted
build: do not create the bundles when updating the public API
- 1.7x faster on my machine (2.7 vs 4.6 min) - should solve the memory issue
1 parent 238c523 commit 6416e79

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

gulpfile.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ function loadTask(fileName, taskName) {
2929

3030
gulp.task('format:enforce', loadTask('format', 'enforce'));
3131
gulp.task('format', loadTask('format', 'format'));
32-
gulp.task('build.sh', loadTask('build'));
32+
gulp.task('build.sh', loadTask('build', 'all'));
33+
gulp.task('build.sh:no-bundle', loadTask('build', 'no-bundle'));
3334
gulp.task('public-api:enforce', loadTask('public-api', 'enforce'));
34-
gulp.task('public-api:update', ['build.sh'], loadTask('public-api', 'update'));
35+
gulp.task('public-api:update', ['build.sh:no-bundle'], loadTask('public-api', 'update'));
3536
gulp.task('lint', ['format:enforce', 'validate-commit-messages', 'tslint']);
3637
gulp.task('tslint', ['tools:build'], loadTask('lint'));
3738
gulp.task('validate-commit-messages', loadTask('validate-commit-message'));

tools/gulp-tasks/build.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11

2-
module.exports = (gulp) => (done) => {
2+
module.exports = {
3+
// build everything and generate bundles
4+
'all': (gulp) => (done) => execBuild(done),
5+
// same as all without the bundling part - faster / lower memory usage
6+
'no-bundle': (gulp) => (done) => execBuild(done, '--bundle=false'),
7+
};
8+
9+
function execBuild(done, args = '') {
310
const path = require('path');
411
const childProcess = require('child_process');
512
// increase maxbuffer to address out of memory exception when running certain tasks
6-
childProcess.exec(path.join(__dirname, '../../build.sh'), {maxBuffer: 300 * 1024}, done);
7-
};
13+
childProcess.exec(path.join(__dirname, `../../build.sh ${args}`), {maxBuffer: 300 * 1024}, done);
14+
}

0 commit comments

Comments
 (0)