-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
77 lines (72 loc) · 2.27 KB
/
next.config.js
File metadata and controls
77 lines (72 loc) · 2.27 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
images: {
domains: ['ipfs.io', 'gateway.ipfs.io', 'cloudflare-ipfs.com', 'ipfs.infura.io'],
},
env: {
WALLET_PRIVATE_KEY: process.env.WALLET_PRIVATE_KEY,
PINATA_JWT: process.env.PINATA_JWT,
STORY_NETWORK: process.env.STORY_NETWORK,
RPC_PROVIDER_URL: process.env.RPC_PROVIDER_URL,
SPG_NFT_CONTRACT_ADDRESS: process.env.SPG_NFT_CONTRACT_ADDRESS,
STABILITY_API_KEY: process.env.STABILITY_API_KEY,
},
async headers() {
return [
{
source: '/api/:path*',
headers: [
{ key: 'Access-Control-Allow-Origin', value: '*' },
{ key: 'Access-Control-Allow-Methods', value: 'GET,OPTIONS,PATCH,DELETE,POST,PUT' },
{ key: 'Access-Control-Allow-Headers', value: 'X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version' },
],
},
]
},
// Webpack configuration
webpack: (config, { isServer }) => {
config.resolve.fallback = {
fs: false,
net: false,
tls: false,
crypto: false,
stream: false,
http: false,
https: false,
zlib: false,
path: false,
os: false,
'pino-pretty': false,
'@react-native-async-storage/async-storage': false,
};
// Suppress warnings for optional dependencies
config.ignoreWarnings = [
{ module: /node_modules\/@metamask\/sdk/ },
{ module: /node_modules\/pino/ },
{ file: /node_modules\/@metamask\/sdk/ },
{ file: /node_modules\/pino/ },
];
// Ignore node_modules from watch
if (!isServer) {
config.watchOptions = {
...config.watchOptions,
ignored: ['**/node_modules', '**/.git', '**/.next'],
};
}
return config;
},
// Page extensions - only these will be treated as pages
pageExtensions: ['tsx', 'ts', 'jsx', 'js'],
// Transpile packages that need it
transpilePackages: ['@rainbow-me/rainbowkit', 'viem', '@story-protocol/core-sdk'],
// Experimental features
experimental: {
serverActions: {
bodySizeLimit: '2mb',
},
serverComponentsExternalPackages: ['pino', 'pino-pretty', '@metamask/sdk'],
},
}
module.exports = nextConfig