-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
Copy pathpayload.config.ts
54 lines (51 loc) · 1.75 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import { mongooseAdapter } from '@payloadcms/db-mongodb'
import { lexicalEditor } from '@payloadcms/richtext-lexical'
import path from 'path'
import { buildConfig } from 'payload'
import { fileURLToPath } from 'url'
import { CustomFields } from './collections/Fields'
import { CustomRootViews } from './collections/RootViews'
import { CustomViews } from './collections/Views'
const filename = fileURLToPath(import.meta.url)
const dirname = path.dirname(filename)
// eslint-disable-next-line no-restricted-exports
export default buildConfig({
admin: {
components: {
afterNavLinks: [
'@/components/afterNavLinks/LinkToCustomView#LinkToCustomView',
'@/components/afterNavLinks/LinkToCustomMinimalView#LinkToCustomMinimalView',
'@/components/afterNavLinks/LinkToCustomDefaultView#LinkToCustomDefaultView',
],
views: {
CustomRootView: {
Component: '@/components/views/CustomRootView#CustomRootView',
path: '/custom',
},
DefaultCustomView: {
Component: '@/components/views/CustomDefaultRootView#CustomDefaultRootView',
path: '/custom-default',
},
MinimalCustomView: {
Component: '@/components/views/CustomMinimalRootView#CustomMinimalRootView',
path: '/custom-minimal',
},
},
},
importMap: {
baseDir: path.resolve(dirname),
},
},
collections: [CustomFields, CustomViews, CustomRootViews],
db: mongooseAdapter({
url: process.env.DATABASE_URI as string,
}),
editor: lexicalEditor({}),
graphQL: {
schemaOutputFile: path.resolve(dirname, 'generated-schema.graphql'),
},
secret: process.env.PAYLOAD_SECRET as string,
typescript: {
outputFile: path.resolve(dirname, 'payload-types.ts'),
},
})