forked from statsfm/web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
executable file
·108 lines (107 loc) · 2.28 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
/* eslint-disable import/no-extraneous-dependencies */
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
const nextBuildId = require('next-build-id');
module.exports = withBundleAnalyzer({
eslint: {
dirs: ['.'],
},
poweredByHeader: false,
trailingSlash: false,
basePath: '',
reactStrictMode: true,
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'cdn.stats.fm',
},
{
protocol: 'https',
hostname: '**.scdn.co',
},
{
protocol: 'https',
hostname: '**.fbcdn.net',
},
{
protocol: 'https',
hostname: '**.fbsbx.com',
},
{
protocol: 'https',
hostname: 'crowdin-static.downloads.crowdin.com',
},
],
},
async redirects() {
return [
{
source: '/account/:path*',
destination: '/settings/:path*',
permanent: false,
},
{
source: '/settings',
destination: '/settings/profile',
permanent: false,
},
{
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: '/artist/:id/:ignore',
destination: '/artist/:id',
},
{
source: '/track/:id/:ignore',
destination: '/track/:id',
},
{
source: '/album/:id/:ignore',
destination: '/album/:id',
},
{
source: '/:id/artists',
destination: '/user/:id/artists',
},
{
source: '/:id/albums',
destination: '/user/:id/albums',
},
{
source: '/:id/tracks',
destination: '/user/:id/tracks',
},
];
},
generateBuildId: () => nextBuildId({ dir: __dirname }),
});