-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathnext.config.ts
More file actions
47 lines (42 loc) · 1.09 KB
/
next.config.ts
File metadata and controls
47 lines (42 loc) · 1.09 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 dotenv from "dotenv";
import createNextIntlPlugin from "next-intl/plugin";
dotenv.config();
const withNextIntl = createNextIntlPlugin();
const isProduction = process.env.NODE_ENV === "production";
const nextConfig: NextConfig = {
output: "standalone",
poweredByHeader: false,
reactCompiler: true,
compress: true,
compiler: {
removeConsole: isProduction,
},
experimental: {
optimizePackageImports: ["@heroui/react", "lucide-react", "lodash", "date-fns"],
},
async rewrites() {
if (!isProduction) {
return [
{
source: "/api/:path*",
destination: `${process.env.CLIENT_BACKEND}/api/:path*`,
},
];
}
return [];
},
async headers() {
return [
{
source: "/:path*",
headers: [
{ key: "X-DNS-Prefetch-Control", value: "on" },
{ key: "X-Content-Type-Options", value: "nosniff" },
{ key: "Referrer-Policy", value: "strict-origin-when-cross-origin" },
],
},
];
},
};
export default withNextIntl(nextConfig);