Skip to content

Commit c52c8ca

Browse files
committed
serve demo at root for gh hosting
1 parent 2b31462 commit c52c8ca

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

gulpfile.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ function css() {
3434
// autoprefix more browsers for demo page
3535
var browsers = ["safari 13"];
3636
if (process.env.NODE_ENV === "demo") {
37-
console.log("its a demo");
3837
browsers = ["last 4 version"];
3938
}
4039

@@ -120,14 +119,20 @@ function html() {
120119
.pipe(connect.reload());
121120
}
122121

122+
function move() {
123+
// only for demo
124+
return src("./demo/index.html")
125+
.pipe(dest("./"))
126+
}
127+
123128
function complete() {
124129
// delete all the files at the output path except the index.html file
125130
// this is a separate function than the clean function above because
126131
// on the intial clean we want to remove EVERYTHING
127132
// on the build complete, we want to leave the index.html
128133
let paths = [
129134
`${outputPath}/**/*`,
130-
`!${outputPath}/index.html`
135+
//`!${outputPath}/index.html`
131136
];
132137
if (process.env.NODE_ENV === "production") {
133138
paths = [
@@ -161,5 +166,5 @@ function watcher(cb) {
161166

162167
exports.build = series(clean, css, js, lib, html, complete);
163168
exports.clean = clean;
164-
exports.demo = series(clean, css, js, lib, html, complete);
169+
exports.demo = series(clean, css, js, lib, html, move, complete);
165170
exports.server = series(clean, css, js, lib, html, parallel(server, watcher));
File renamed without changes.

0 commit comments

Comments
 (0)