mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
build(): Refactor Gulpfile to TS
This commit is contained in:
33
tools/gulp/tasks/clean.ts
Normal file
33
tools/gulp/tasks/clean.ts
Normal file
@@ -0,0 +1,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'));
|
||||
Reference in New Issue
Block a user