forked from spaceness/stardust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.mjs
53 lines (52 loc) · 1.15 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
// @ts-check
import NextBundleAnalyzer from "@next/bundle-analyzer";
import { execSync } from "node:child_process";
/** @type {import('next').NextConfig} */
const 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(),
},
experimental: {
ppr: true,
typedRoutes: true,
instrumentationHook: true,
webpackBuildWorker: true,
reactCompiler: 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);