Skip to content

Commit

Permalink
VITE_PROD_ORIGIN in Vite build
Browse files Browse the repository at this point in the history
  • Loading branch information
oscartbeaumont committed Sep 14, 2024
1 parent a368466 commit 97256f4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sst.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ export default $config({
policy: webPolicy.then((p) => p.json),
});

const VITE_PROD_ORIGIN = `https://${renderZoneDomain(zone, webSubdomain)}`;
const env: { [K in keyof Env]: $util.Input<Env[K]> } = {
NODE_ENV: "production",
INTERNAL_SECRET: INTERNAL_SECRET.result,
Expand All @@ -217,7 +218,7 @@ export default $config({
ENTRA_CLIENT_ID: ENTRA_CLIENT_ID.value,
ENTRA_CLIENT_SECRET: ENTRA_CLIENT_SECRET.value,
COOKIE_DOMAIN: renderZoneDomain(zone, "@"),
VITE_PROD_ORIGIN: `https://${renderZoneDomain(zone, webSubdomain)}`,
VITE_PROD_ORIGIN,
};

const web = CloudflarePages("web", {
Expand All @@ -231,6 +232,7 @@ export default $config({
environment: {
NITRO_PRESET: "cloudflare_pages",
NODE_ENV: "production",
VITE_PROD_ORIGIN,
},
},
site: {
Expand Down

0 comments on commit 97256f4

Please sign in to comment.