2025-05-08 15:12:32 +07:00
|
|
|
import { postgresAdapter } from '@payloadcms/db-postgres';
|
|
|
|
|
import { lexicalEditor } from '@payloadcms/richtext-lexical';
|
|
|
|
|
import path from 'path';
|
|
|
|
|
import { buildConfig } from 'payload';
|
|
|
|
|
import sharp from 'sharp';
|
|
|
|
|
import { fileURLToPath } from 'url';
|
|
|
|
|
|
2025-05-10 05:35:24 +07:00
|
|
|
import { CommunitiesSection } from './collections/CommunitiesSection';
|
2025-05-10 04:08:37 +07:00
|
|
|
import { FeaturesSection } from './collections/FeaturesSection';
|
2025-05-10 03:32:19 +07:00
|
|
|
import { HeroSection } from './collections/HeroSection';
|
2025-05-08 15:12:32 +07:00
|
|
|
import { Media } from './collections/Media';
|
|
|
|
|
import { Users } from './collections/Users';
|
|
|
|
|
|
|
|
|
|
const filename = fileURLToPath(import.meta.url);
|
|
|
|
|
const dirname = path.dirname(filename);
|
|
|
|
|
|
|
|
|
|
export default buildConfig({
|
|
|
|
|
admin: {
|
|
|
|
|
user: Users.slug,
|
|
|
|
|
importMap: {
|
|
|
|
|
importMapFile: path.resolve(
|
|
|
|
|
__dirname,
|
|
|
|
|
'app',
|
|
|
|
|
'(payload)',
|
|
|
|
|
'admin',
|
|
|
|
|
'importMap.js'
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
collections: [Users, Media],
|
2025-05-10 05:35:24 +07:00
|
|
|
globals: [HeroSection, FeaturesSection, CommunitiesSection],
|
2025-05-08 15:12:32 +07:00
|
|
|
editor: lexicalEditor(),
|
|
|
|
|
secret: process.env.CMS_SECRET || '',
|
|
|
|
|
typescript: {
|
|
|
|
|
outputFile: path.resolve(dirname, 'payload-types.ts'),
|
|
|
|
|
},
|
|
|
|
|
db: postgresAdapter({
|
|
|
|
|
pool: {
|
|
|
|
|
connectionString: process.env.CMS_POSTGRES_URL || '',
|
|
|
|
|
},
|
|
|
|
|
}),
|
|
|
|
|
sharp,
|
|
|
|
|
plugins: [],
|
|
|
|
|
});
|