if any other peep bashing their head with this trash documentation here is the solution edit your

if any other peep bashing their head with this trash documentation here is the solution

edit your
vite.config.ts
like so (or add these lines)

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

// https://vite.dev/config/
export default defineConfig({
  plugins: [react()],
  define: {
    "import.meta.env.CF_PAGES": JSON.stringify(process.env.CF_PAGES || "1"),
    "import.meta.env.CF_PAGES_URL": JSON.stringify(process.env.CF_PAGES_URL || "unresolved"),
    "import.meta.env.CF_PAGES_BRANCH": JSON.stringify(process.env.CF_PAGES_BRANCH || "unresolved"),
    "import.meta.env.CF_PAGES_COMMIT_SHA": JSON.stringify(process.env.CF_PAGES_COMMIT_SHA || "unknown"),
  },
})
Was this page helpful?