add cloudflare env process
This commit is contained in:
9297
cloudflare-env.d.ts
vendored
Normal file
9297
cloudflare-env.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,7 @@ import sharp from 'sharp' // sharp-import
|
|||||||
import path from 'path'
|
import path from 'path'
|
||||||
import { buildConfig, PayloadRequest } from 'payload'
|
import { buildConfig, PayloadRequest } from 'payload'
|
||||||
import { fileURLToPath } from 'url'
|
import { fileURLToPath } from 'url'
|
||||||
|
import { r2Storage } from '@payloadcms/storage-r2'
|
||||||
import { Categories } from './collections/Categories'
|
import { Categories } from './collections/Categories'
|
||||||
import { Media } from './collections/Media'
|
import { Media } from './collections/Media'
|
||||||
import { Pages } from './collections/Pages'
|
import { Pages } from './collections/Pages'
|
||||||
@@ -66,8 +66,10 @@ export default buildConfig({
|
|||||||
cors: [getServerSideURL()].filter(Boolean),
|
cors: [getServerSideURL()].filter(Boolean),
|
||||||
globals: [Header, Footer],
|
globals: [Header, Footer],
|
||||||
plugins: [
|
plugins: [
|
||||||
...plugins,
|
r2Storage({
|
||||||
// storage-adapter-placeholder
|
bucket: cloudflare.env.R2,
|
||||||
|
collections: { media: true },
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
secret: process.env.PAYLOAD_SECRET,
|
secret: process.env.PAYLOAD_SECRET,
|
||||||
sharp,
|
sharp,
|
||||||
|
|||||||
Reference in New Issue
Block a user