-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.ts
119 lines (114 loc) · 2.75 KB
/
next.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/* eslint-disable @typescript-eslint/no-var-requires */
// next.config.js
import { withSentryConfig } from '@sentry/nextjs';
import type { NextConfig } from 'next';
const nextConfig: NextConfig = {
cacheMaxMemorySize: 0,
productionBrowserSourceMaps: true,
skipMiddlewareUrlNormalize: true,
i18n: {
locales: ['en', 'pt'],
defaultLocale: 'en',
localeDetection: false,
},
images: {
// domains: ['images.neopets.com', 'magnetismotimes.com'],
remotePatterns: [
{
protocol: 'https',
hostname: 'magnetismotimes.com',
},
{
protocol: 'https',
hostname: '**.neopets.com',
},
{
protocol: 'https',
hostname: '**.blogspot.com',
},
{
protocol: 'https',
hostname: '**.imgur.com',
},
{
protocol: 'https',
hostname: '**.wp.com',
},
{
protocol: 'https',
hostname: '**.itemdb.com.br',
},
],
minimumCacheTTL: 2592000,
},
distDir: process.env.BUILD_DIR || '.next',
experimental: {
reactCompiler: true,
largePageDataBytes: 512 * 1000,
optimizePackageImports: [
'@sentry/nextjs',
'axios',
'framer-motion',
'@chakra-ui/react',
'@chakra-ui/icons',
'firebase',
'lightweight-charts',
'lodash',
'@emotion/react',
'@emotion/styled',
'@dnd-kit/core',
'@dnd-kit/sortable',
],
},
async headers() {
return [
{
// list more extensions here if needed; these are all the resources in the `public` folder including the subfolders
source: '/:all*(svg|jpg|png|gif|ttf|ico)',
locale: false,
headers: [
{
key: 'Cache-Control',
value: 'public, max-age=31536000, stale-while-revalidate',
},
],
},
];
},
async redirects() {
return [
{
source: '/api/v1/cache/:slug*',
destination: '/api/cache/:slug*',
permanent: false,
},
{
source: '/api/search/:slug*',
destination: '/api/v1/search/:slug*',
permanent: true,
},
{
source: '/hub/faeriefestival2023',
destination: '/hub/faeriefestival',
permanent: true,
},
];
},
transpilePackages: ['lightweight-charts', 'fancy-canvas'],
webpack: (config, { webpack }) => {
config.plugins.push(
new webpack.DefinePlugin({
__SENTRY_DEBUG__: false,
// __SENTRY_TRACING__: false,
})
);
return config;
},
};
// const withBundleAnalyzer = require('@next/bundle-analyzer')({
// enabled: false,
// })
const sentryWebpackPluginOptions = {
silent: true, // Suppresses all logs
};
module.exports = withSentryConfig(nextConfig, sentryWebpackPluginOptions);