- Convert all 40+ public/images/figma assets from raw PNG/JPG to WebP at max 1920px, 82% quality: 397 MB → 13 MB total (96.7% reduction) - Update all component image references to .webp - Add 1-year Cache-Control headers for /images/* and /_next/static/* - Fix GallerySlider initial scroll offset (first card no longer clipped by mask) - Fix arrow2.svg missing explicit width/height (Lighthouse unsized-images) - Hero, LocationsSlider: aspect-ratio height + seamless infinite loop (prior session) - Add drizzle-kit to dependencies for production schema push (prior session) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
92 lines
2.3 KiB
TypeScript
92 lines
2.3 KiB
TypeScript
import { buildConfig } from 'payload'
|
|
import { postgresAdapter } from '@payloadcms/db-postgres'
|
|
import { lexicalEditor } from '@payloadcms/richtext-lexical'
|
|
import sharp from 'sharp'
|
|
import path from 'path'
|
|
import { fileURLToPath } from 'url'
|
|
|
|
import { Users } from './src/collections/Users'
|
|
import { Media } from './src/collections/Media'
|
|
import { Pages } from './src/collections/Pages'
|
|
import { BlogPosts } from './src/collections/BlogPosts'
|
|
import { Categories } from './src/collections/Categories'
|
|
import { Tags } from './src/collections/Tags'
|
|
import { Tariffs } from './src/collections/Tariffs'
|
|
import { Leads } from './src/collections/Leads'
|
|
import { Orders } from './src/collections/Orders'
|
|
import { Locations } from './src/collections/Locations'
|
|
import { Reviews } from './src/collections/Reviews'
|
|
import { BirthdayPackages } from './src/collections/BirthdayPackages'
|
|
|
|
import { HomePage } from './src/globals/HomePage'
|
|
import { CheckoutPage } from './src/globals/CheckoutPage'
|
|
import { ThankYouPage } from './src/globals/ThankYouPage'
|
|
import { Header } from './src/globals/Header'
|
|
import { Footer } from './src/globals/Footer'
|
|
import { SiteSettings } from './src/globals/SiteSettings'
|
|
|
|
const filename = fileURLToPath(import.meta.url)
|
|
const dirname = path.dirname(filename)
|
|
|
|
const siteURL = process.env['NEXT_PUBLIC_SITE_URL'] ?? 'http://localhost:3000'
|
|
|
|
export default buildConfig({
|
|
secret: process.env['PAYLOAD_SECRET']!,
|
|
serverURL: siteURL,
|
|
|
|
db: postgresAdapter({
|
|
pool: {
|
|
connectionString: process.env['DATABASE_URL']!,
|
|
},
|
|
push: true,
|
|
migrationDir: path.resolve(dirname, 'migrations'),
|
|
}),
|
|
|
|
editor: lexicalEditor(),
|
|
sharp,
|
|
|
|
collections: [
|
|
Users,
|
|
Media,
|
|
Pages,
|
|
BlogPosts,
|
|
Categories,
|
|
Tags,
|
|
Tariffs,
|
|
Leads,
|
|
Orders,
|
|
Locations,
|
|
Reviews,
|
|
BirthdayPackages,
|
|
],
|
|
|
|
globals: [HomePage, CheckoutPage, ThankYouPage, Header, Footer, SiteSettings],
|
|
|
|
admin: {
|
|
user: 'users',
|
|
livePreview: {
|
|
url: siteURL,
|
|
collections: ['pages'],
|
|
globals: [
|
|
'home-page',
|
|
'checkout-page',
|
|
'thank-you-page',
|
|
'header',
|
|
'footer',
|
|
'site-settings',
|
|
],
|
|
},
|
|
},
|
|
|
|
i18n: {
|
|
fallbackLanguage: 'en',
|
|
},
|
|
|
|
cors: [siteURL],
|
|
|
|
typescript: {
|
|
outputFile: path.resolve(dirname, 'src/payload-types.ts'),
|
|
},
|
|
|
|
telemetry: false,
|
|
})
|