mirror of
https://github.com/supabase/supabase.git
synced 2026-10-16 06:39:09 +03:00
78 lines
1.8 KiB
TypeScript
78 lines
1.8 KiB
TypeScript
import { postgresAdapter } from '@payloadcms/db-postgres'
|
|
import path from 'path'
|
|
import { buildConfig } from 'payload'
|
|
import { fileURLToPath } from 'url'
|
|
import sharp from 'sharp'
|
|
import { plugins } from './plugins'
|
|
import { defaultLexical } from '@/fields/defaultLexical'
|
|
import { getServerSideURL } from './utilities/getURL'
|
|
|
|
import { Authors } from './collections/Authors'
|
|
import { Categories } from './collections/Categories'
|
|
import { Customers } from './collections/Customers'
|
|
import { Events } from './collections/Events'
|
|
import { Media } from './collections/Media'
|
|
import { Pages } from './collections/Pages'
|
|
import { Posts } from './collections/Posts'
|
|
import { Tags } from './collections/Tags'
|
|
import { Users } from './collections/Users'
|
|
|
|
const filename = fileURLToPath(import.meta.url)
|
|
const dirname = path.dirname(filename)
|
|
|
|
export default buildConfig({
|
|
admin: {
|
|
user: Users.slug,
|
|
importMap: {
|
|
baseDir: path.resolve(dirname),
|
|
},
|
|
livePreview: {
|
|
breakpoints: [
|
|
{
|
|
label: 'Mobile',
|
|
name: 'mobile',
|
|
width: 375,
|
|
height: 667,
|
|
},
|
|
{
|
|
label: 'Tablet',
|
|
name: 'tablet',
|
|
width: 768,
|
|
height: 1024,
|
|
},
|
|
{
|
|
label: 'Desktop',
|
|
name: 'desktop',
|
|
width: 1440,
|
|
height: 900,
|
|
},
|
|
],
|
|
},
|
|
},
|
|
collections: [
|
|
Authors,
|
|
Categories,
|
|
Customers,
|
|
Events,
|
|
Media,
|
|
Pages,
|
|
Posts,
|
|
Tags,
|
|
Users
|
|
],
|
|
editor: defaultLexical,
|
|
secret: process.env.PAYLOAD_SECRET,
|
|
typescript: {
|
|
outputFile: path.resolve(dirname, 'payload-types.ts'),
|
|
},
|
|
cors: [getServerSideURL()].filter(Boolean),
|
|
db: postgresAdapter({
|
|
pool: {
|
|
connectionString: process.env.DATABASE_URI || '',
|
|
},
|
|
schemaName: 'cms-payload',
|
|
}),
|
|
sharp,
|
|
plugins
|
|
})
|