-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.ts
40 lines (32 loc) · 942 Bytes
/
gulpfile.ts
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
34
35
36
37
38
39
40
import {Levels, Log} from '@toreda/log';
import {series, src} from 'gulp';
import {Build} from '@toreda/build-tools';
import {EventEmitter} from 'events';
const log = new Log({
consoleEnabled: true,
globalLevel: Levels.ALL
});
const build: Build = new Build({
log: log,
events: new EventEmitter(),
linter: {
globInputPaths: true,
warnIgnored: true
}
});
async function runLint(): Promise<NodeJS.ReadWriteStream> {
return build.gulpSteps.lint({
formatterId: 'stylish',
srcPatterns: ['./src/**.ts', './src/**/**.ts']
});
}
function createDist(): Promise<NodeJS.ReadWriteStream> {
return build.gulpSteps.createDir('./dist', true);
}
function cleanDist(): Promise<NodeJS.ReadWriteStream> {
return build.gulpSteps.cleanDir('./dist', true);
}
function buildSrc(): Promise<NodeJS.ReadWriteStream> {
return build.run.typescript('./dist', 'tsconfig.json');
}
export default series(createDist, cleanDist, runLint, buildSrc);