Enrich plugin JS URLs when SSR'ing apps
This commit is contained in:
parent
b148b7d004
commit
d5cde049a7
|
@ -1,3 +1,6 @@
|
||||||
|
import { Plugin } from "@budibase/types"
|
||||||
|
import { enrichPluginURLs } from "../../../utilities/plugins"
|
||||||
|
|
||||||
require("svelte/register")
|
require("svelte/register")
|
||||||
|
|
||||||
const send = require("koa-send")
|
const send = require("koa-send")
|
||||||
|
@ -22,6 +25,7 @@ const fs = require("fs")
|
||||||
const {
|
const {
|
||||||
downloadTarballDirect,
|
downloadTarballDirect,
|
||||||
} = require("../../../utilities/fileSystem/utilities")
|
} = require("../../../utilities/fileSystem/utilities")
|
||||||
|
const { isMultiTenant } = require("@budibase/backend-core/tenancy")
|
||||||
|
|
||||||
async function prepareUpload({ s3Key, bucket, metadata, file }: any) {
|
async function prepareUpload({ s3Key, bucket, metadata, file }: any) {
|
||||||
const response = await upload({
|
const response = await upload({
|
||||||
|
@ -107,12 +111,13 @@ export const serveApp = async function (ctx: any) {
|
||||||
|
|
||||||
if (!env.isJest()) {
|
if (!env.isJest()) {
|
||||||
const App = require("./templates/BudibaseApp.svelte").default
|
const App = require("./templates/BudibaseApp.svelte").default
|
||||||
|
const plugins = enrichPluginURLs(appInfo.usedPlugins)
|
||||||
const { head, html, css } = App.render({
|
const { head, html, css } = App.render({
|
||||||
title: appInfo.name,
|
title: appInfo.name,
|
||||||
production: env.isProd(),
|
production: env.isProd(),
|
||||||
appId,
|
appId,
|
||||||
clientLibPath: clientLibraryPath(appId, appInfo.version, ctx),
|
clientLibPath: clientLibraryPath(appId, appInfo.version, ctx),
|
||||||
usedPlugins: appInfo.usedPlugins,
|
usedPlugins: plugins,
|
||||||
})
|
})
|
||||||
|
|
||||||
const appHbs = loadHandlebarsFile(`${__dirname}/templates/app.hbs`)
|
const appHbs = loadHandlebarsFile(`${__dirname}/templates/app.hbs`)
|
||||||
|
|
Loading…
Reference in New Issue