-
Notifications
You must be signed in to change notification settings - Fork 140
/
gulpfile.js
26 lines (26 loc) · 850 Bytes
/
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
const gulp = require("gulp");
const del = require("del");
/**
* Builds the Firebase-ready version of the PWA, moving the necessary
* files to the functions folder to be used by PRPL Server
*/
gulp.task("firebase", () => {
// These are the files needed by PRPL Server, that are going to be moved to the functions folder
const filesToMove = ["build/polymer.json", "build/**/index.html"];
// Delete the build folder inside the functions folder
return (
del("functions/build")
.then(
() =>
// Copy the files needed by PRPL Server
new Promise(resolve =>
gulp
.src(filesToMove, { base: "." })
.pipe(gulp.dest("functions"))
.on("end", resolve)
)
)
// Delete them from the original build
.then(() => del(filesToMove))
);
});