-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
68 lines (58 loc) · 1.7 KB
/
next.config.ts
File metadata and controls
68 lines (58 loc) · 1.7 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
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
/* config options here */
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'hsp-ec.xyz',
port: '',
pathname: '/**',
},
// Allow external HTTPS images from any hostname. This is permissive —
// prefer listing trusted hosts in production if possible.
{
protocol: 'https',
hostname: '**',
port: '',
pathname: '/**',
},
],
},
// Configure webpack to ignore LICENSE files
webpack: (config) => {
config.module = config.module || {};
config.module.rules = config.module.rules || [];
config.module.rules.push({
test: /LICENSE$/,
use: 'ignore-loader',
});
return config;
},
// Disable ESLint for production build
eslint: {
ignoreDuringBuilds: true,
},
async rewrites() {
const posthogUiHost = process.env.POSTHOG_UI_HOST || "https://eu.posthog.com"
const posthogAssetsHost =
process.env.POSTHOG_UI_HOST ||
(posthogUiHost.includes("eu.posthog") ? "https://eu-assets.i.posthog.com" : "https://us-assets.i.posthog.com")
const posthogApiHost =
process.env.POSTHOG_UI_HOST ||
(posthogUiHost.includes("eu.posthog") ? "https://eu.i.posthog.com" : "https://us.i.posthog.com")
return [
{
source: "/blob/static/:path*",
destination: `${posthogAssetsHost}/static/:path*`,
},
{
source: "/blob/:path*",
destination: `${posthogApiHost}/:path*`,
},
];
},
// This is required to support PostHog trailing slash API requests
skipTrailingSlashRedirect: true,
};
export default nextConfig;