-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
60 lines (53 loc) · 1.48 KB
/
gulpfile.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
const gulp = require('gulp')
const rollup = require('rollup')
const ts = require('gulp-typescript');
const tsProject = ts.createProject('tsconfig.json', { declaration: true });
const clean = require('gulp-clean')
gulp.task('buildJs', () => {
return tsProject.src()
.pipe(tsProject({
declaration: true
}))
.pipe(gulp.dest('./build'));
})
gulp.task('cleanJs', () => {
return gulp
.src('./build/**/*.js', { read: false })
.pipe(clean('*.js'));
});
gulp.task("rollup", async function() {
let config = {
input: "build/FairyGUI.js",
output: {
file: 'FairyGUI.js',
format: 'umd',
extend: true,
name: 'fgui'
},
plugins: [
// resolve()
]
};
const subTask2 = await rollup.rollup(config);
await subTask2.write(config);
});
gulp.task("movejs", function() {
return gulp.src("FairyGUI.js")
.pipe(gulp.dest('../panorama-fgui-types/fgui'));
});
gulp.task("move", function() {
return gulp.src("build/**")
.pipe(gulp.dest('../panorama-fgui-types/fgui'));
});
gulp.task("movetypes", function() {
return gulp.src("mymodule/panorama-types/types/**")
.pipe(gulp.dest('../panorama-fgui-types/types'));
});
gulp.task('build', gulp.series(
gulp.parallel('buildJs'),
gulp.parallel('rollup'),
gulp.parallel('cleanJs'),
gulp.parallel('move'),
gulp.parallel('movejs'),
gulp.parallel('movetypes'),
))