-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
71 lines (62 loc) · 1.59 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
/* eslint-disable @typescript-eslint/no-var-requires */
const withBundleAnalyzer = require("@next/bundle-analyzer");
const { withSentryConfig } = require("@sentry/nextjs");
const { withContentlayer } = require("next-contentlayer");
/** @type {import('next').NextConfig} */
let nextConfig = {
reactStrictMode: true,
swcMinify: true,
modularizeImports: {
"@fortawesome/free-solid-svg-icons": {
transform: "@fortawesome/free-solid-svg-icons/{{member}}",
preventFullImport: true,
skipDefaultConversion: true,
},
"@fortawesome/free-brands-svg-icons": {
transform: "@fortawesome/free-brands-svg-icons/{{member}}",
preventFullImport: true,
skipDefaultConversion: true,
},
},
async redirects() {
return [
{
source: "/tools",
destination: "/stack",
permanent: true,
},
];
},
async rewrites() {
return [
{
source: "/cal/embed.js",
destination: "https://app.cal.com/embed/embed.js",
},
{
source: "/bee.js",
destination: "https://cdn.splitbee.io/sb.js",
},
{
source: "/_hive/:slug",
destination: "https://hive.splitbee.io/:slug",
},
];
},
};
nextConfig = withContentlayer(nextConfig);
if (process.env.NEXT_PUBLIC_SENTRY_DSN) {
nextConfig.sentry = {
hideSourceMaps: true,
tunnelRoute: "/api/reporter",
};
nextConfig = withSentryConfig(nextConfig, {
silent: true,
});
}
if (process.env.ANALYZE === "true") {
nextConfig = withBundleAnalyzer({
enabled: true,
})(nextConfig);
}
module.exports = nextConfig;