-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
47 lines (43 loc) · 1.35 KB
/
Copy pathnext.config.ts
File metadata and controls
47 lines (43 loc) · 1.35 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
import { type NextConfig } from "next";
import redirects from "./config/next/redirects";
import { type SentryBuildOptions, withSentryConfig } from "@sentry/nextjs";
const nextConfig = {
images: {
contentSecurityPolicy: "default-src 'self'; script-src 'none'; sandbox;",
dangerouslyAllowSVG: true,
remotePatterns: [
{ hostname: "i.scdn.co" },
{ hostname: "spotify.com" },
{ hostname: "*.ibb.co" }, // for gallery images
{
hostname: "a.ltrbxd.com",
},
],
},
reactStrictMode: true,
async redirects() {
return redirects;
},
} satisfies NextConfig;
const sentryBuildOptions = {
// For all available options, see:
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
disableLogger: true,
org: "ali4heydari",
project: "ali4heydari-dot-tech",
tunnelRoute: "/monitoring",
widenClientFileUpload: true,
} satisfies SentryBuildOptions;
// https://github.com/cyrilwanner/next-compose-plugins/issues/59#issuecomment-1341060113
export default (phase: any, defaultConfig: NextConfig): NextConfig => {
const plugins = [(cfg) => withSentryConfig(cfg, sentryBuildOptions)];
return plugins.reduce(
(acc, plugin) => {
const update = plugin(acc);
return typeof update === "function"
? update(phase, defaultConfig)
: update;
},
{ ...nextConfig },
);
};