aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--demo/index.html2
-rw-r--r--gulpfile.js17
2 files changed, 16 insertions, 3 deletions
diff --git a/demo/index.html b/demo/index.html
index 21dcfe62..8c5b5ed4 100644
--- a/demo/index.html
+++ b/demo/index.html
@@ -178,7 +178,7 @@
<script src="https://cdn.rangetouch.com/1.0.1/rangetouch.js" async></script>
<!-- Docs script -->
- <script src="dist/demo.js?v=2"></script>
+ <script src="dist/demo.js"></script>
</body>
</html> \ No newline at end of file
diff --git a/gulpfile.js b/gulpfile.js
index 6bb28ad1..8dc3cf57 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -321,14 +321,27 @@ if (Object.keys(aws).includes('cdn') && Object.keys(aws).includes('demo')) {
// Replace local file paths with remote paths in demo HTML
// e.g. "../dist/plyr.js" to "https://cdn.plyr.io/x.x.x/plyr.js"
+ const index = `${paths.demo.root}index.html`;
+ const error = `${paths.demo.root}error.html`;
+ const pages = [index];
+
+ if (branch.current === branch.master) {
+ pages.push(error);
+ }
+
gulp
- .src([`${paths.demo.root}*.html`])
+ .src(pages)
.pipe(replace(localPath, versionPath))
.pipe(s3(aws.demo, options.demo));
+ // Only update CDN for master (prod)
+ if (branch.current !== branch.master) {
+ return null;
+ }
+
// Upload error.html to cdn (as well as demo site)
return gulp
- .src([`${paths.demo.root}error.html`])
+ .src([error])
.pipe(replace(localPath, versionPath))
.pipe(s3(aws.cdn, options.demo));
});