build(): Refactor Gulpfile to TS

This commit is contained in:
Livio
2019-08-07 22:08:01 +02:00
parent 202a572ea4
commit 06861628eb
16 changed files with 338 additions and 173 deletions

33
tools/gulp/tasks/clean.ts Normal file
View 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'));