-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
43 lines (36 loc) · 1.05 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
const jetpack = require("fs-jetpack");
const gulp = require("gulp");
const luaminify = require("gulp-luaminify");
const multiDest = require("gulp-multi-dest");
const plumber = require("gulp-plumber");
const watch = require("gulp-watch");
const SOURCE = "./src";
const DESTINATIONS = ["./dist"];
require("dotenv").config()
if (process.env.COPY_TO) {
DESTINATIONS.push(
jetpack.path(process.env.COPY_TO, "network")
);
}
gulp.task("watch", function() {
gulp.src(SOURCE + "/**/*", {base: SOURCE})
.pipe(watch(SOURCE, {base: SOURCE}))
.pipe(plumber())
.pipe(multiDest(DESTINATIONS));
});
gulp.task("watch-minify", function() {
gulp.src(SOURCE + "/**/*", {base: SOURCE})
.pipe(watch(SOURCE, {base: SOURCE}))
.pipe(plumber())
.pipe(luaminify())
.pipe(multiDest(DESTINATIONS));
});
gulp.task("build", function() {
gulp.src(SOURCE + "/**/*", {base: SOURCE})
.pipe(multiDest(DESTINATIONS));
});
gulp.task("build-minify", function() {
gulp.src(SOURCE + "/**/*", {base: SOURCE})
.pipe(luaminify())
.pipe(multiDest(DESTINATIONS));
});