-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnext.config.mjs
67 lines (64 loc) · 1.39 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import { withFaust, getWpHostname } from "@faustwp/core";
import { withWPEConfig } from "@wpengine/atlas-next";
import { createSecureHeaders } from "next-secure-headers";
import redirectsOldSite from "./redirects-old-site.mjs";
import { DOCS_PATH } from "./src/lib/remote-mdx-files.mjs";
const newRedirects = [
{
source: "/discord",
destination: "https://discord.gg/headless-wordpress-836253505944813629",
permanent: false,
},
{
source: "/community-meeting",
destination:
"https://discord.gg/headless-wordpress-836253505944813629?event=1336404483013480588",
permanent: false,
},
];
/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
trailingSlash: true,
reactStrictMode: true,
pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"],
sassOptions: {
includePaths: ["node_modules"],
},
eslint: {
ignoreDuringBuilds: true,
},
redirects() {
return [...redirectsOldSite, ...newRedirects];
},
images: {
remotePatterns: [
{
protocol: "https",
hostname: getWpHostname(),
pathname: "/**",
},
{
protocol: "https",
hostname: "raw.githubusercontent.com",
pathname: DOCS_PATH + "/**",
},
],
},
i18n: {
locales: ["en"],
defaultLocale: "en",
},
async headers() {
return [
{
source: "/:path*",
headers: createSecureHeaders({
xssProtection: false,
}),
},
];
},
};
export default withWPEConfig(withFaust(nextConfig));