-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathgulpfile.js
73 lines (55 loc) · 2.4 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
61
62
63
64
65
66
67
68
69
70
71
72
73
const gulp = require("gulp");
const rename = require("gulp-rename");
const del = require("del");
gulp.task("compile-tailwind", function () {
const postcss = require("gulp-postcss");
return gulp
.src("./src/index.css")
.pipe(postcss([require("tailwindcss"), require("autoprefixer")]))
.pipe(gulp.dest("src/assets/css/"))
.pipe(rename("tailwind.css"));
});
gulp.task("rename-css", function () {
return gulp
.src("./src/assets/css/index.css")
.pipe(rename("tailwind.css"))
.pipe(gulp.dest("src/assets/css/"));
});
gulp.task("clean-css", function () {
return del(["src/assets/css/index.css"]);
});
gulp.task("clean-pre-python-build", function () {
console.log("Removing any pre-existing python folders and files before build...");
console.log("Removing src/pyflaskdist/ ...");
console.log("Removing build/ ...");
console.log("Removing api.spec ...");
return del(["src/pyflaskdist", "./api.spec", "./build"]);
});
gulp.task("clean-pre-electron-build", function () {
console.log("Removing any pre-existing electron folders before build...");
console.log("Removing dist_electron/ ...");
return del(["./dist_electron"]);
});
gulp.task("copy-python", function () {
console.log("Copying src/pyflask folder to dist_electron folder...");
return gulp.src(["./src/pyflask/**/*"]).pipe(gulp.dest("./dist_electron/pyflask"));
});
gulp.task("copy-splash-screen", function () {
console.log("Copying splash screen to dist_electron folder ...");
return gulp.src(["./public/splash-screen.html"]).pipe(gulp.dest("./dist_electron"));
});
gulp.task("copy-app-icon", function () {
console.log("Copying app icon to dist_electron folder ...");
return gulp.src(["./src/assets/app-icons/Icon.png"]).pipe(gulp.dest("./dist_electron"));
});
gulp.task("build-css", gulp.series("compile-tailwind", "rename-css", "clean-css"));
gulp.task("copy-all", gulp.parallel("copy-python", "copy-splash-screen", "copy-app-icon"));
gulp.task("watch-dev", function () {
gulp.watch("./src/index.css", gulp.series("build-css"));
gulp.watch("./tailwind.config.js", gulp.series("build-css"));
gulp.watch("./src/app.vue", gulp.series("build-css"));
gulp.watch("./src/components/**/*", gulp.series("build-css"));
gulp.watch("./src/views/**/*", gulp.series("build-css"));
gulp.watch("./src/pyflask/**/*", gulp.series("copy-python"));
gulp.watch("./src/splash-screen.html", gulp.series("copy-splash-screen"));
});