-
Notifications
You must be signed in to change notification settings - Fork 14
/
next.config.ts
52 lines (52 loc) · 1.22 KB
/
next.config.ts
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
import { execSync } from "node:child_process";
import NextBundleAnalyzer from "@next/bundle-analyzer";
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
images: {
remotePatterns: [
{
protocol: "https",
hostname: "*",
port: "",
pathname: "/**",
},
],
},
env: {
GIT_COMMIT: process.env.NODE_ENV === "production" ? execSync("git rev-parse HEAD").toString().trim() : "DEVELOP",
BUILD_DATE: Date.now().toString(),
TURNSTILE_SITEKEY: JSON.parse(process.env.CONFIG || "").auth.turnstile?.siteKey,
},
experimental: {
ppr: true,
typedRoutes: true,
webpackBuildWorker: true,
reactCompiler: true,
after: true,
serverActions: {
allowedOrigins: ["localhost:3000", "*.use.devtunnels.ms"],
},
},
async redirects() {
return [
{
source: "/api/auth/error",
destination: "/auth/error",
permanent: true,
},
];
},
webpack(config, { webpack }) {
config.module.rules.push({
test: /\.node$/,
loader: "node-loader",
});
config.plugins.push(
new webpack.IgnorePlugin({
resourceRegExp: /^pg-native$|^cloudflare:sockets$/,
}),
);
return config;
},
};
export default NextBundleAnalyzer({ enabled: process.env.ANALYZE === "true" })(nextConfig);