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