-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.mjs
66 lines (61 loc) · 1.63 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
// @ts-check
import redirects from "./config/next/redirects.mjs";
import { withSentryConfig } from "@sentry/nextjs";
import million from "million/compiler";
/** @type { import("next").NextConfig } */
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;
},
swcMinify: true,
};
const millionConfig = {
auto: { rsc: true },
rsc: true,
};
const sentryBuildOptions = {
// For all available options, see:
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
disableLogger: true,
hideSourceMaps: true,
org: "ali4heydari",
project: "ali4heydari-dot-tech",
sourcemaps: {
disable: process.env.SENTRY_IS_DRY_RUN === "true",
},
tunnelRoute: "/monitoring",
widenClientFileUpload: true,
};
// https://github.com/cyrilwanner/next-compose-plugins/issues/59#issuecomment-1341060113
export default (
/** @type {any} */ phase,
/** @type {import("next").NextConfig} */ defaultConfig,
) => {
const plugins = [
(cfg) => million.next(cfg, millionConfig),
(cfg) => withSentryConfig(cfg, sentryBuildOptions),
];
return plugins.reduce(
(acc, plugin) => {
const update = plugin(acc);
return typeof update === "function"
? // @ts-ignore
update(phase, defaultConfig)
: update;
},
{ ...nextConfig },
);
};