-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgulpfile.js
30 lines (24 loc) · 1.03 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
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("./src/views/**/*.ejs").pipe(gulp.dest("./dist/views"));
});
// Task which would just create a copy of the current static assets directory in dist directory
gulp.task("assets", function () {
return gulp.src("./src/public/assets/**/*").pipe(gulp.dest("./dist/public/assets"));
});
// The default task which runs at start of the gulpfile.js
gulp.task("default", gulp.series("build-clean","typescript", "views", "assets"), () => {
console.log("Done");
});