-
-
Notifications
You must be signed in to change notification settings - Fork 169
Expand file tree
/
Copy pathnext.config.js
More file actions
78 lines (71 loc) · 2.04 KB
/
next.config.js
File metadata and controls
78 lines (71 loc) · 2.04 KB
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
/** @type {import('next').NextConfig} */
const withMDX = require("@next/mdx")();
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
});
const REMOTE_PATTERNS = [
"images.ctfassets.net",
"images.unsplash.com",
"avatars.githubusercontent.com",
"www.gravatar.com",
// Temporary wildcard
"*.s3.eu-west-1.amazonaws.com",
"s3.eu-west-1.amazonaws.com",
].map((hostname) => ({
hostname,
protocol: "https",
}));
const config = {
async redirects() {
return [
{
source: "/newsletter",
destination: "https://newsletter.codu.co",
permanent: true,
},
{
source: "/newsletter/:path*",
destination: "https://newsletter.codu.co",
permanent: true,
},
// Redirect legacy feed article URLs to new unified pattern
// /feed/[sourceSlug]/[articleId] -> /[sourceSlug]/[articleId]
{
source: "/feed/:sourceSlug/:articleId",
destination: "/:sourceSlug/:articleId",
permanent: true,
},
// Redirect legacy feed source URLs to new unified pattern
// /feed/[sourceSlug] -> /[sourceSlug]
{
source: "/feed/:sourceSlug",
destination: "/:sourceSlug",
permanent: true,
},
];
},
// Turbopack configuration for SVGR (replaces webpack config)
turbopack: {
rules: {
"*.svg": {
loaders: ["@svgr/webpack"],
as: "*.js",
},
},
},
pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"],
images: {
remotePatterns: REMOTE_PATTERNS,
},
// Note: i18n is not supported in App Router - use middleware for i18n instead
// Note: experimental.instrumentationHook is now auto-detected in Next.js 16
// Note: typescript.ignoreBuildErrors removed - fixing TS errors as part of upgrade
};
// Injected content via Sentry wizard below
const { withSentryConfig } = require("@sentry/nextjs");
module.exports = withSentryConfig(withMDX(withBundleAnalyzer(config)), {
silent: true,
org: "codu",
project: "codu",
hideSourceMaps: true,
});