-
Notifications
You must be signed in to change notification settings - Fork 12
/
next.config.js
64 lines (60 loc) 路 1.6 KB
/
next.config.js
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
const { i18n } = require('./next-i18next.config')
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})
const moduleExports = {
i18n,
reactStrictMode: true,
productionBrowserSourceMaps: false,
webpack(config) {
config.resolve.fallback = {
fs: false,
net: false,
tls: false,
'react-native': false,
}
config.externals.push('pino-pretty', 'lokijs', 'encoding')
config.optimization.moduleIds = 'deterministic'
config.optimization.chunkIds = 'deterministic'
config.optimization.minimize = true
config.module.rules.push({
test: /\.svg$/i,
issuer: /\.[jt]sx?$/,
use: ['@svgr/webpack'],
})
config.ignoreWarnings = [{ module: /node_modules\/next-i18next/ }]
return config
},
images: {
minimumCacheTTL: 31536000,
domains: [
'assets.coingecko.com',
'everipedia.org',
'ipfs.everipedia.org',
'gateway.pinata.cloud',
'i3.ytimg.com',
'alpha.everipedia.org',
'raw.githubusercontent.com',
'beta.everipedia.org',
'iq.wiki',
'images.mirror-media.xyz',
'cdn.buttercms.com',
'icons.iq.wiki',
],
},
async rewrites() {
return [
{
source: '/ingest/static/:path*',
destination: 'https://us-assets.i.posthog.com/static/:path*',
},
{
source: '/ingest/:path*',
destination: 'https://us.i.posthog.com/:path*',
},
]
},
// This is required to support PostHog trailing slash API requests
trailingSlash: true,
}
module.exports = withBundleAnalyzer(moduleExports)