-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.mjs
39 lines (36 loc) · 907 Bytes
/
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
/** @type {import('next').NextConfig} */
const ANALYTICS_BASE_URL = "https://hn-ping2.hashnode.com";
const HASHNODE_ADVANCED_ANALYTICS_URL = "https://user-analytics.hashnode.com";
const HASHNODE_BASE_PATH = process.env.NEXT_PUBLIC_HASHNODE_BASE_PATH;
const nextConfig = {
experimental: {
scrollRestoration: true,
},
images: {
unoptimized: true,
remotePatterns: [
{
protocol: "https",
hostname: "cdn.hashnode.com",
},
],
},
async rewrites() {
return [
{
source: `${HASHNODE_BASE_PATH || ""}/ping/data-event`,
destination: `${ANALYTICS_BASE_URL}/api/data-event`,
},
{
source: `${HASHNODE_BASE_PATH || ""}/api/analytics`,
destination: `${HASHNODE_ADVANCED_ANALYTICS_URL}/api/analytics`,
},
];
},
logging: {
fetches: {
fullUrl: true,
},
},
};
export default nextConfig;