Skip to content

Commit b79a0a2

Browse files
committed
Create clean task
1 parent b95a793 commit b79a0a2

File tree

3 files changed

+154
-0
lines changed

3 files changed

+154
-0
lines changed

gulpfile.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import { dest, watch } from 'gulp';
44
import * as ts from 'gulp-typescript';
5+
import * as del from 'del';
56

67
const project = ts.createProject('tsconfig.json');
78

@@ -12,3 +13,9 @@ export function compile(): NodeJS.ReadWriteStream {
1213
export function monitor(): NodeJS.EventEmitter {
1314
return watch('src/**/*.ts', compile);
1415
}
16+
17+
export function clean(): Promise<void> {
18+
return del(['build/**/*.js', 'build/**/*.d.ts']).then(paths => {
19+
paths.forEach(path => console.log(`Deleted ${path}`));
20+
});
21+
}

package-lock.json

Lines changed: 146 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"@types/node": "^16.10.1",
2424
"@typescript-eslint/eslint-plugin": "^4.31.2",
2525
"@typescript-eslint/parser": "^4.31.2",
26+
"del": "^6.0.0",
2627
"eslint": "^7.32.0",
2728
"eslint-config-prettier": "^8.3.0",
2829
"gulp": "^4.0.2",

0 commit comments

Comments
 (0)