forked from searchfe/san-ssr-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.ts
44 lines (40 loc) · 1.16 KB
/
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
41
42
43
44
import gulp from 'gulp';
import babel from 'gulp-babel';
import del from 'del';
gulp.task('build:ts', () => {
return gulp.src(['./src/**/*.ts', '!./src/**/*.d.ts'])
// @ts-ignore
.pipe(babel({
presets: [
// @ts-ignore
[
'@babel/preset-typescript',
{
allExtensions: true,
},
],
// @ts-ignore
[
'@babel/preset-env',
{
'targets': {
'node': true,
},
},
],
],
}))
.pipe(gulp.dest('./dist'));
});
gulp.task('copy:code', () => {
return gulp.src('./src/**/*.{js,php}', {root: './src'})
.pipe(gulp.dest('./dist'));
});
gulp.task('copy:dts', () => {
return gulp.src('./src/**/*.d.ts', {root: './src'})
.pipe(gulp.dest('./dist'));
});
gulp.task('clean:dist', () => {
return del(['dist']);
});
gulp.task('build', gulp.series(['clean:dist', gulp.parallel(['build:ts', 'copy:dts', 'copy:code'])]));