-
-
Notifications
You must be signed in to change notification settings - Fork 225
/
next.config.js
189 lines (183 loc) · 4.55 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
const millionLint = process.env.USE_MILLION_LINT ? require("@million/lint").next() : (config) => config;
const interests = [
"javascript",
"python",
"java",
"typescript",
"angular",
"csharp",
"cpp",
"php",
"c",
"ruby",
"ai",
"ml",
"react",
"golang",
"rust",
"svelte",
"vue",
"kubernetes",
"clojure",
"kotlin",
"android",
];
/** @type {import('next').NextConfig} */
module.exports = millionLint({
productionBrowserSourceMaps: true,
reactStrictMode: true,
experimental: {
instrumentationHook: true,
},
images: {
remotePatterns: [
{
protocol: "https",
hostname: "avatars.githubusercontent.com",
},
{
protocol: "https",
hostname: "images.unsplash.com",
},
{
protocol: "https",
hostname: "www.github.com",
},
{
protocol: "https",
hostname: "github.com",
},
{
protocol: "https",
hostname: "res.cloudinary.com",
},
],
},
async redirects() {
return [
{
source: "/user/:username/highlights",
destination: "/user/:username?tab=highlights",
permanent: true,
},
{
source: "/user/:username/contributions",
destination: "/user/:username?tab=contributions",
permanent: true,
},
{
source: "/user/:username/recommendations",
destination: "/user/:username?tab=recommendations",
permanent: true,
},
{
source: "/user/:username/requests",
destination: "/user/:username?tab=requests",
permanent: true,
},
{
source: "/lists/:listId",
destination: "/lists/:listId/overview",
permanent: true,
},
{
source: "/lists/:listId/contributors",
destination: "/lists/:listId/overview",
permanent: true,
},
{
source: "/hub/lists/find",
destination: "/",
permanent: true,
},
{
source: "/hub/lists/new",
destination: "/",
permanent: true,
},
{
source: "/hub/lists",
destination: "/",
permanent: true,
},
{
source: "/hub/insights/:insightId/accept",
destination: "/",
permanent: true,
},
{
source: "/hub/insights/:insightId/edit",
destination: "/",
permanent: true,
},
{
source: "/hub/insights",
destination: "/",
permanent: true,
},
{
source: "/hub/insights/new",
destination: "/workspaces/new",
permanent: true,
},
...interests.map((interest) => {
return {
source: `/${interest}/:tool(dashboard|reports|contributors|activity)`,
destination: `/explore`,
permanent: true,
};
}),
{
source: `/explore/topic/:slug*`,
destination: `/explore`,
permanent: true,
},
...interests.map((interest) => {
return {
source: `/${interest}`,
destination: `/explore`,
permanent: true,
};
}),
{
source: "/star-search/waitlist",
destination: "/star-search",
permanent: true,
},
{
source: "/user/:user((?!settings|notifications$).*)",
destination: "/u/:user",
permanent: true,
},
];
},
});
// Injected content via Sentry wizard below
const { withSentryConfig } = require("@sentry/nextjs");
module.exports = millionLint(
withSentryConfig(
module.exports,
{
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options
// Suppresses source map uploading logs during build
silent: true,
org: "opensauced",
project: process.env.NODE_ENV === "production" ? "app-opensauced" : "beta-app-opensauced",
},
{
// For all available options, see:
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
// Upload a larger set of source maps for prettier stack traces (increases build time)
widenClientFileUpload: true,
// Transpiles SDK to be compatible with IE11 (increases bundle size)
transpileClientSDK: false,
// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
tunnelRoute: "/monitoring",
// Hides source maps from generated client bundles
hideSourceMaps: true,
// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
}
)
);