yarn upgrade
Some checks failed
deploy to production / deploy (push) Failing after 49s

This commit is contained in:
2024-04-09 14:47:44 +00:00
parent de97bd9560
commit 6f1ab474fc
216 changed files with 1294 additions and 1127 deletions

View File

@@ -31,7 +31,7 @@ const distDir = frontendDir + "/dist"
const svelteConfig = require("./svelte.config")
const esbuildSvelte = sveltePlugin({
compilerOptions: {
css: false,
css: "external",
hydratable: true,
dev: (process.argv?.length > 2 ? process.argv[2] : "build") !== "build",
},
@@ -74,7 +74,8 @@ if (process.argv[2] == "start") {
const TIBI_NAMESPACE = dotEnv.match(/TIBI_NAMESPACE=(.*)/)[1]
const apiBase = process.env.API_BASE || "http://localhost:8080/api/v1/_/" + TIBI_NAMESPACE
bsMiddleware.push(
createProxyMiddleware("/api", {
createProxyMiddleware({
pathFilter: "/api",
target: apiBase,
pathRewrite: { "^/api": "" },
changeOrigin: true,
@@ -82,29 +83,20 @@ if (process.argv[2] == "start") {
})
)
// if SSR env variable is set
console.log(process.env, "=========================ENV")
if (process.env.SSR) {
// read api/config.yml.env and read SSR_TOKEN variable from it
const configEnv = fs.readFileSync(__dirname + "/api/config.yml.env", "utf8")
const SSR_TOKEN = configEnv.match(/SSR_TOKEN=(.*)/)[1]
// redirect all other requests to /api/ssr?token=owshwerNwoa&url=...
bsMiddleware.push(
createProxyMiddleware(
function (path, req) {
createProxyMiddleware({
pathFilter: function (path, req) {
return !path.match(/\./)
},
{
target: apiBase,
changeOrigin: true,
logLevel: "debug",
pathRewrite: function (path, req) {
console.log(path)
return "/ssr?token=" + SSR_TOKEN + "&url=" + encodeURIComponent(path)
},
}
)
target: apiBase,
changeOrigin: true,
logLevel: "debug",
pathRewrite: function (path, req) {
console.log(path)
return "/ssr?url=" + encodeURIComponent(path)
},
})
)
}
}