Publish script tweaks
This commit is contained in:
parent
bacd049eb0
commit
2e5d06ad85
@ -178,7 +178,7 @@
|
|||||||
<script src="https://cdn.rangetouch.com/1.0.1/rangetouch.js" async></script>
|
<script src="https://cdn.rangetouch.com/1.0.1/rangetouch.js" async></script>
|
||||||
|
|
||||||
<!-- Docs script -->
|
<!-- Docs script -->
|
||||||
<script src="dist/demo.js?v=2"></script>
|
<script src="dist/demo.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
17
gulpfile.js
17
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
|
// 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"
|
// 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
|
gulp
|
||||||
.src([`${paths.demo.root}*.html`])
|
.src(pages)
|
||||||
.pipe(replace(localPath, versionPath))
|
.pipe(replace(localPath, versionPath))
|
||||||
.pipe(s3(aws.demo, options.demo));
|
.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)
|
// Upload error.html to cdn (as well as demo site)
|
||||||
return gulp
|
return gulp
|
||||||
.src([`${paths.demo.root}error.html`])
|
.src([error])
|
||||||
.pipe(replace(localPath, versionPath))
|
.pipe(replace(localPath, versionPath))
|
||||||
.pipe(s3(aws.cdn, options.demo));
|
.pipe(s3(aws.cdn, options.demo));
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user