-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This reverts commit b297925.
- Loading branch information
Showing
3 changed files
with
3,901 additions
and
5,509 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,26 @@ | ||
/* eslint-disable turbo/no-undeclared-env-vars */ | ||
import { defineConfig } from "astro/config"; | ||
import sitemap from "@astrojs/sitemap"; | ||
import vercel from "@astrojs/vercel/serverless"; | ||
|
||
const SERVER_PORT = 3000; | ||
const LOCALHOST_URL = `http://localhost:${SERVER_PORT}`; | ||
const LIVE_URL = "https://thephilosophicalcode.com"; | ||
|
||
const SCRIPT = process.env.npm_lifecycle_script || ""; | ||
const isBuild = SCRIPT.includes("astro build"); | ||
|
||
let BASE_URL = LOCALHOST_URL; | ||
|
||
if (isBuild) { | ||
BASE_URL = LIVE_URL; | ||
} | ||
|
||
if (process.env.VERCEL_ENV === "preview" || process.env.VERCEL_ENV === "development") { | ||
BASE_URL = `https://${process.env.VERCEL_URL}`; | ||
} | ||
|
||
// https://astro.build/config | ||
export default defineConfig({ | ||
server: { | ||
port: SERVER_PORT | ||
}, | ||
server: { port: SERVER_PORT }, | ||
site: BASE_URL, | ||
integrations: [sitemap()], | ||
output: "static", | ||
adapter: vercel({ | ||
webAnalytics: { | ||
enabled: true | ||
}, | ||
speedInsights: { | ||
enabled: true | ||
} | ||
}) | ||
integrations: [sitemap()] | ||
}); |
Oops, something went wrong.