forked from nestjs/nest
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclean.ts
More file actions
33 lines (30 loc) · 696 Bytes
/
Copy pathclean.ts
File metadata and controls
33 lines (30 loc) · 696 Bytes
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
import { task, src, series } from 'gulp';
import { source } from '../config';
import * as clean from 'gulp-clean';
import * as deleteEmpty from 'delete-empty';
/**
* Cleans the build output assets from the packages folders
*/
function cleanOutput() {
return src(
[
`${source}/**/*.js`,
`${source}/**/*.d.ts`,
`${source}/**/*.js.map`,
`${source}/**/*.d.ts.map`,
],
{
read: false,
},
).pipe(clean());
}
/**
* Cleans empty dirs
*/
function cleanDirs(done: () => void) {
deleteEmpty.sync(`${source}/`);
done();
}
task('clean:output', cleanOutput);
task('clean:dirs', cleanDirs);
task('clean:bundle', series('clean:output', 'clean:dirs'));