-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgulpfile.js
47 lines (43 loc) · 1.51 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
var gulp = require("gulp");
var clean = require("gulp-clean");
var ts = require('gulp-typescript');
var zip = require('gulp-zip');
var webpack = require("webpack-stream");
var merge2 = require("merge2");
var sequence = require('run-sequence');
var tsProject = ts.createProject('tsconfig.json');
gulp.task('compileTs', function () {
var tsResult = tsProject.src()
.pipe(tsProject());
return tsResult.js
.pipe(gulp.dest('./release/ReactKanbanBoard/widget'));
});
gulp.task("otherFiles", function () {
return merge2([
gulp.src(["ReactKanbanBoard/widget/ui/*.*"])
.pipe(gulp.dest("./bundle/com/mendix/widget/custom/ReactKanbanBoard/ui/")),
gulp.src(["./*.xml"])
.pipe(gulp.dest("bundle/")),
gulp.src(["ReactKanbanBoard/*.xml"])
.pipe(gulp.dest("bundle/ReactKanbanBoard/")),
])
});
gulp.task("clean", function () {
return gulp.src("./release/")
.pipe(clean({ force: true }));
});
gulp.task("zip", function () {
return gulp.src("./bundle/**/*")
.pipe(zip("ReactKanbanBoard.mpk"))
.pipe(gulp.dest("./test/widgets/"))
})
gulp.task('webpack', () =>
gulp.src("./release/ReactKanbanBoard/widget/ReactKanbanBoard.js")
.pipe(webpack(require("./webpack.config.js")))
.pipe(gulp.dest("./bundle"))
)
gulp.task("taskList", sequence(["compileTs", "otherFiles"], "webpack", "zip"));
gulp.task("watch", function () {
gulp.watch("./ReactKanbanBoard/**/*", ["taskList"]);
});
gulp.task("default", ["clean", "watch"]);