-
Notifications
You must be signed in to change notification settings - Fork 395
/
Copy pathnext.config.mjs
105 lines (100 loc) · 2.27 KB
/
next.config.mjs
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
/** @type {import('next').NextConfig} */
import("dotenv").then(({ config }) => config({ path: "../../.env" }));
import fs from "fs";
import path from "path";
const packageJson = JSON.parse(
fs.readFileSync(path.resolve("./package.json"), "utf8")
);
const { version } = packageJson;
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
transpilePackages: ["@cap/ui", "@cap/utils", "@cap/web-api-contract"],
eslint: {
ignoreDuringBuilds: true,
},
typescript: {
ignoreBuildErrors: true,
},
experimental: {
optimizePackageImports: ["@cap/ui", "@cap/utils", "@cap/web-api-contract"],
serverComponentsExternalPackages: [
"@react-email/components",
"@react-email/render",
"@react-email/tailwind",
],
},
images: {
remotePatterns: [
{
protocol: "https",
hostname: "**",
port: "",
pathname: "**",
},
{
protocol: "https",
hostname: "l.cap.so",
port: "",
pathname: "**",
},
process.env.NODE_ENV === "development" && {
protocol: "http",
hostname: "localhost",
port: "3902",
pathname: "**",
},
].filter(Boolean),
},
async rewrites() {
return [
{
source: "/r/:path*",
destination: "https://dub.cap.link/:path*",
},
{
source: "/api/commercial/:path*",
destination: "https://l.cap.so/api/commercial/:path*",
},
{
source: '/s/:videoId',
destination: '/s/:videoId',
has: [
{
type: 'host',
value: '(?!cap\.so|cap\.link).*',
},
],
}
];
},
async redirects() {
return [
{
source: "/roadmap",
destination:
"https://capso.notion.site/7aac740edeee49b5a23be901a7cb734e?v=9d4a3bf3d72d488cad9b899ab73116a1",
permanent: true,
},
{
source: "/updates",
destination: "/blog",
permanent: true,
},
{
source: "/updates/:slug",
destination: "/blog/:slug",
permanent: true,
},
{
source: "/docs/s3-config",
destination: "/docs",
permanent: true,
},
];
},
env: {
appVersion: version,
},
};
export default nextConfig;