-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathgulpfile.mjs
45 lines (36 loc) · 1.01 KB
/
gulpfile.mjs
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
41
42
43
44
45
import gulp from 'gulp';
import { deleteAsync } from 'del';
import babel from 'gulp-babel';
import eslint from 'gulp-eslint';
import excludeGitignore from 'gulp-exclude-gitignore';
const BALM = {
compiler: {
src: 'packages/balm-core/src/**/*.ts',
dest: 'packages/balm-core/lib'
},
runtime: {
src: 'packages/balm/src/**/*.js',
dest: 'packages/balm/lib'
}
};
const { task, src, dest, series } = gulp;
function clean() {
return deleteAsync([BALM.compiler.dest, BALM.runtime.dest]);
}
function buildCore() {
return src(BALM.compiler.src).pipe(babel()).pipe(dest(BALM.compiler.dest));
}
function buildRuntime() {
return src(BALM.runtime.src).pipe(babel()).pipe(dest(BALM.runtime.dest));
}
const build = series(buildCore, buildRuntime);
task('format', function () {
return src(BALM.compiler.src)
.pipe(excludeGitignore())
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
task('clean', clean);
task('build', build);
task('prepublish', series(clean, build));