-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathnext.config.mjs
More file actions
87 lines (77 loc) · 1.93 KB
/
next.config.mjs
File metadata and controls
87 lines (77 loc) · 1.93 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
79
80
81
82
83
84
85
86
87
import path from "node:path";
import { fileURLToPath } from "node:url";
import createNextIntlPlugin from "next-intl/plugin";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const domain = process.env.NEXT_PUBLIC_SERVER_DOMAIN || "ppy.sh";
const shouldUnoptimizeImages = process.env.NEXT_PUBLIC_UNOPTIMIZED_IMAGES === "true";
/** @type {import('next').NextConfig} */
const nextConfig = {
webpack(config) {
config.module.rules.push({
test: /\.svg$/i,
issuer: /\.[jt]sx?$/,
use: [{ loader: "@svgr/webpack", options: { icon: true } }],
});
config.resolve.alias["next/link"] = path.resolve(
__dirname,
"lib/overrides/next/link",
);
return config;
},
turbopack: {
rules: {
"*.svg": {
loaders: [
{
loader: "@svgr/webpack",
options: {
svgoConfig: {
plugins: [
{
name: "preset-default",
params: {
overrides: {
removeViewBox: false,
},
},
},
"removeDimensions",
],
},
},
},
],
as: "*.js",
},
},
},
images: {
unoptimized: shouldUnoptimizeImages,
remotePatterns: [
{
protocol: "https",
hostname: `a.${domain}`,
pathname: "**",
},
{
protocol: "https",
hostname: "assets.ppy.sh",
pathname: "**",
},
{
protocol: "https",
hostname: "a.ppy.sh",
pathname: "**",
},
{
protocol: "https",
hostname: "osu.ppy.sh",
pathname: "**",
},
],
},
reactStrictMode: false,
};
const withNextIntl = createNextIntlPlugin("./lib/i18n/request.ts");
export default withNextIntl(nextConfig);