1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-09-16 19:45:33 -04:00

don't load fathom script unless on production

This commit is contained in:
2022-05-16 09:40:36 -04:00
parent cf4f2fe442
commit 2f695be18f
12 changed files with 40 additions and 46 deletions

View File

@@ -1,11 +1,9 @@
// Next.js constants (not needed in frontend)
import path from "path";
// directory containing .mdx files relative to project root
export const NOTES_DIR = "./notes";
export const NOTES_DIR = path.join(process.cwd(), "notes");
// normalize the timestamp saved when building/deploying (see next.config.js) and fall back to right now:
export const RELEASE_DATE = new Date(process.env.NEXT_PUBLIC_RELEASE_DATE ?? Date.now()).toISOString();
// detect current backend environment
export const IS_PROD = process.env.NEXT_PUBLIC_VERCEL_ENV === "production";
export const IS_DEV_SERVER = !!process.env.IS_DEV_SERVER;