-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.esm.js
28 lines (21 loc) · 925 Bytes
/
gulpfile.esm.js
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
/* globals require, console, __dirname */
import { spawn } from "child_process";
import gulp from "gulp";
const buildLolTinyLoader = () => shellExec(`npx tsc -p ${"src/LolTinyLoader"}`);
const buildModulesSample = () => shellExec(`npx tsc -p ${"src/ModulesSample"}`);
const buildTests = () => shellExec(`npx tsc -p ${"src/Tests"}`);
export const build = gulp.parallel(buildLolTinyLoader, buildModulesSample, buildTests);
const runTests = () => shellExec(`npx karma start src/Tests/karma.conf.js --single-run`);
export const test = gulp.series(build, runTests);
function copyToDist() {
return gulp.src([
"src/LolTinyLoader/*.ts",
"src/LolTinyLoader/bin/*.d.ts",
"src/LolTinyLoader/bin/*.js"
]).pipe(gulp.dest("dist"));
}
export const dist = gulp.series(test, copyToDist);
export default dist;
function shellExec(command) {
return spawn(command, { shell: true, stdio: "inherit" });
}