-
Notifications
You must be signed in to change notification settings - Fork 28
/
next.config.js
executable file
·115 lines (114 loc) · 2.58 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
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
/* eslint-disable import/no-extraneous-dependencies */
/**
* @type {(config: import('next/dist/server/config').NextConfig) => import('next/dist/server/config').NextConfig}
*/
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
module.exports = withBundleAnalyzer({
output: 'standalone',
eslint: {
dirs: ['.'],
},
poweredByHeader: false,
trailingSlash: false,
basePath: '',
reactStrictMode: true,
images: {
loader: 'custom',
loaderFile: './src/utils/imageLoader.ts',
},
optimizeFonts: false,
async redirects() {
return [
{
source: '/account/:path*',
destination: '/settings/:path*',
permanent: false,
},
{
source: '/settings',
destination: '/settings/profile',
permanent: false,
},
{
source: '/import',
destination: '/settings/imports',
permanent: true,
},
{
source: '/settings/gift',
destination: '/gift',
permanent: true,
},
{
source: '/settings/gift/success',
destination: '/gift/success',
permanent: true,
},
{
source: '/discord',
destination: 'https://stats.fm/discord',
permanent: false,
},
{
source: '/jobs',
destination: '/careers',
permanent: false,
},
];
},
async rewrites() {
return [
{
source: '/:id',
destination: '/user/:id',
},
{
source: '/:id/friends',
destination: '/user/:id/friends',
},
{
source: '/:id/streams',
destination: '/user/:id/streams',
},
{
source: '/:id/compare',
destination: '/user/:id/compare',
},
{
source: '/:id/artists',
destination: '/user/:id/artists',
},
{
source: '/:id/albums',
destination: '/user/:id/albums',
},
{
source: '/:id/tracks',
destination: '/user/:id/tracks',
},
{
source: '/:id/listeningClocks',
destination: '/user/:id/listening-clocks',
},
{
source: '/:id/listening-clocks',
destination: '/user/:id/listening-clocks',
},
{
source: '/:id/genres',
destination: '/user/:id/genres',
},
{
source: '/:id/recentStreams',
destination: '/user/:id/recent-streams',
},
{
source: '/:id/recent-streams',
destination: '/user/:id/recent-streams',
},
];
},
generateBuildId: () => 'statsfm-site',
});