-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpFile.js
41 lines (35 loc) · 1.2 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
var gulp = require("gulp");
var ts = require("gulp-typescript");
var tsProject = ts.createProject("tsconfig.json");
var del = require("del");
// Task which would transpile typescript to javascript
gulp.task("typescript", function () {
return tsProject.src().pipe(tsProject()).js.pipe(gulp.dest("dist"));
});
// Task which would delete the old dist directory if present
gulp.task("build-clean", function () {
return del(["./dist"]);
});
// Task which would just create a copy of the current views directory in dist directory
gulp.task("views", function () {
return gulp.src("./dashboard/views/**/*.ejs").pipe(gulp.dest("./dist/dashboard/views"));
});
// Task which would just create a copy of the current static assets directory in dist directory
gulp.task("assets", function () {
return gulp
.src("./dashboard/public/**/*")
.pipe(gulp.dest("./dist/dashboard/public/"));
});
gulp.task(
"locales", () => {
return gulp.src('./data/language/**/*.json').pipe(gulp.dest('./dist/data/language/'));
}
)
// The default task which runs at start of the gulpfile.js
gulp.task(
"default",
gulp.series("build-clean", "typescript", "views", "assets", "locales"),
() => {
console.log("Done");
}
);