Repository navigation
Expand file tree
/
Copy pathnext.config.js
More file actions
116 lines (113 loc) · 3.46 KB
/
Copy pathnext.config.js
File metadata and controls
116 lines (113 loc) · 3.46 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
const createNextIntlPlugin = require("next-intl/plugin");
const withNextIntl = createNextIntlPlugin();
const allowAllHeader = [
{ key: "Access-Control-Allow-Credentials", value: "true" },
{ key: "Access-Control-Allow-Origin", value: "*" },
{ key: "Access-Control-Allow-Methods", value: "GET" },
{
key: "Access-Control-Allow-Headers",
value: "X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version",
},
];
const nextConfig = {
reactStrictMode: true,
env: {
API_V1_URL: process.env.NEXT_PUBLIC_API_V1_URL,
API_V1_IP_URL: process.env.NEXT_PUBLIC_API_V1_IP_URL,
API_VERSION: process.env.NEXT_PUBLIC_API_VERSION,
},
images: {
remotePatterns: [
{
protocol: "https",
hostname: "*.hdruk.cloud",
pathname: "/**",
},
{
protocol: "http",
hostname: "*.hdruk.cloud",
pathname: "/**",
},
{
protocol: "https",
hostname: "storage.googleapis.com",
pathname: "/hdr-gw-wordpress-dev/**",
},
{
protocol: "https",
hostname: "storage.googleapis.com",
pathname: "/hdr-gw-wordpress-preprod/**",
},
{
protocol: "https",
hostname: "storage.googleapis.com",
pathname: "/hdr-gw-wordpress-prod/**",
},
...(process.env.NODE_ENV === "development"
? [
{
protocol: "http",
hostname: "localhost",
pathname: "/**",
},
]
: []),
],
},
async headers() {
return [
{
source: "/(.*)",
headers: [
{
key: "Strict-Transport-Security",
value: "max-age=63072000; includeSubDomains; preload",
},
],
},
{
source: "/api/widget/:path*",
headers: allowAllHeader,
},
{
source: "/embed/widget.js",
headers: allowAllHeader,
},
];
},
async rewrites() {
return [
{
source: "/robots.txt",
destination: "/api/robots",
},
];
},
async redirects() {
return [
{
source: "/about/terms-and-conditions",
destination: "/terms-and-conditions",
permanent: true,
},
{
source: "/data-custodian/getting-started",
destination: "/data-custodian/support/getting-started",
permanent: true,
},
{
source: "/data-custodian/metadata-onboarding",
destination: "/data-custodian/support/metadata-onboarding",
permanent: true,
},
];
},
typescript: {
// !! WARN !!
// Dangerously allow production builds to successfully complete even if
// your project has type errors.
// !! WARN !!
ignoreBuildErrors: true,
},
};
module.exports = withNextIntl(nextConfig);