Skip to content

Commit

Permalink
Revert "add vercel analytics"
Browse files Browse the repository at this point in the history
This reverts commit b297925.
  • Loading branch information
houzyk committed Dec 15, 2023
1 parent b297925 commit 4d3c76d
Show file tree
Hide file tree
Showing 3 changed files with 3,901 additions and 5,509 deletions.
22 changes: 7 additions & 15 deletions astro.config.mjs
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()]
});
Loading

0 comments on commit 4d3c76d

Please sign in to comment.