-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
62 lines (57 loc) · 1.64 KB
/
Copy pathnext.config.js
File metadata and controls
62 lines (57 loc) · 1.64 KB
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
55
56
57
58
59
60
61
62
require('dotenv').config()
const path = require('path')
const { withPayload } = require('@payloadcms/next-payload')
module.exports = withPayload(
{
reactStrictMode: true,
swcMinify: true,
images: {
remotePatterns: [
{
protocol: 'https',
hostname: '**',
},
{
protocol: 'http',
hostname: '**',
},
],
dangerouslyAllowSVG: true,
contentDispositionType: 'attachment',
contentSecurityPolicy: "default-src 'self'; script-src 'none'; sandbox;",
},
webpack: (config, { isServer }) => {
// Handle fs fallback
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
}
// Add babel-loader for Undici
config.module.rules.push({
test: /\.js$/,
include: /node_modules\/undici/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
plugins: [
'@babel/plugin-proposal-private-methods',
'@babel/plugin-proposal-class-properties',
],
},
},
})
return config
},
},
{
// The second argument to `withPayload`
// allows you to specify paths to your Payload dependencies
// and configure the admin route to your Payload CMS.
// Point to your Payload config (required)
configPath: path.resolve(__dirname, './src/payload.config.ts'),
// Set a custom Payload admin route (optional, default is `/admin`)
// NOTE: Read the "Set a custom admin route" section in the payload/next-payload README.
adminRoute: '/admin',
},
)