forked from nestjs/nest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
35 lines (29 loc) · 1.05 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
const gulp = require('gulp');
const ts = require('gulp-typescript');
const gulpSequence = require('gulp-sequence')
const packages = {
common: ts.createProject('src/common/tsconfig.json'),
core: ts.createProject('src/core/tsconfig.json'),
microservices: ts.createProject('src/microservices/tsconfig.json'),
websockets: ts.createProject('src/websockets/tsconfig.json'),
testing: ts.createProject('src/testing/tsconfig.json')
};
const modules = Object.keys(packages);
const source = 'src';
const distId = process.argv.indexOf('--dist');
const dist = distId < 0 ? 'node_modules/@nestjs' : process.argv[distId + 1];
gulp.task('default', function () {
modules.forEach((module) => {
gulp.watch([`${source}/${module}/**/*.ts`, `${source}/${module}/*.ts`], [module]);
});
});
modules.forEach((module) => {
gulp.task(module, () => {
return packages[module].src()
.pipe(packages[module]())
.pipe(gulp.dest(`${dist}/${module}`));
});
});
gulp.task('build', function (cb) {
gulpSequence(modules, cb);
});