-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpayload.config.ts
39 lines (32 loc) · 931 Bytes
/
payload.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { buildConfig } from 'payload/config';
import { mongooseAdapter } from '@payloadcms/db-mongodb';
import { webpackBundler } from '@payloadcms/bundler-webpack';
import { lexicalEditor } from '@payloadcms/richtext-lexical';
import path from 'path';
import { Media, Page, User } from './cms/collections';
import { seed } from './cms/seed';
export default buildConfig({
serverURL: process.env.NEXT_PUBLIC_SERVER_URL,
admin: {
user: User.slug,
bundler: webpackBundler(),
css: path.resolve(__dirname, '/cms/styles/custom.scss'),
},
routes: {
admin: '/admin',
},
db: mongooseAdapter({
url: process.env.MONGO_URL,
}),
indexSortableFields: true,
editor: lexicalEditor({}),
collections: [Page, Media, User],
onInit: async (payload) => {
if (
process.env.NODE_ENV === 'development'
&& (process.env.PAYLOAD_SEED_DATABASE)
) {
await seed(payload);
}
},
});