Merge pull request #8006 from Budibase/cloud-plugins

Use CDN when fetching plugins in cloud
This commit is contained in:
Martin McKeaveney 2022-09-27 19:05:10 +01:00 committed by GitHub
commit c5aedcd05c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -16,6 +16,7 @@
themeStore, themeStore,
appStore, appStore,
devToolsStore, devToolsStore,
environmentStore,
} from "stores" } from "stores"
import NotificationDisplay from "components/overlay/NotificationDisplay.svelte" import NotificationDisplay from "components/overlay/NotificationDisplay.svelte"
import ConfirmationDisplay from "components/overlay/ConfirmationDisplay.svelte" import ConfirmationDisplay from "components/overlay/ConfirmationDisplay.svelte"
@ -47,6 +48,8 @@
!$builderStore.inBuilder && !$builderStore.inBuilder &&
$devToolsStore.enabled && $devToolsStore.enabled &&
!$routeStore.queryParams?.peek !$routeStore.queryParams?.peek
$: objectStoreUrl = $environmentStore.cloud ? "https://cdn.budi.live" : ""
$: pluginsUrl = `${objectStoreUrl}/plugins`
// Handle no matching route // Handle no matching route
$: { $: {
@ -92,7 +95,8 @@
<svelte:head> <svelte:head>
{#if $builderStore.usedPlugins?.length} {#if $builderStore.usedPlugins?.length}
{#each $builderStore.usedPlugins as plugin (plugin.hash)} {#each $builderStore.usedPlugins as plugin (plugin.hash)}
<script src={`/plugins/${plugin.jsUrl}?r=${plugin.hash || ""}`}></script> <script
src={`${pluginsUrl}/${plugin.jsUrl}?r=${plugin.hash || ""}`}></script>
{/each} {/each}
{/if} {/if}
</svelte:head> </svelte:head>