-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.js
65 lines (63 loc) · 1.53 KB
/
next.config.js
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
// next.config.js
const createNextPluginPreval = require("next-plugin-preval/config");
const generateRobotsTxt = require("./scripts/generate-robots-txt");
const withNextPluginPreval = createNextPluginPreval();
const STUDIO_REWRITE = {
source: "/studio/:path*",
destination:
process.env.NODE_ENV === "development"
? "http://localhost:3333/studio/:path*"
: "/studio/index.html",
};
const OG_REWRITE = {
source: "/opengraph/:path*",
destination: `${process.env.OG_URL}/:path*`,
permanent: true,
};
module.exports = withNextPluginPreval({
i18n: {
locales: ["en", "ar", "ru", "zh"],
defaultLocale: "en",
localeDetection: false,
domains: [
{
domain: "www.blesshost.com",
defaultLocale: "en",
},
{
domain: "ae.blesshost.com",
defaultLocale: "ar",
},
{
domain: "ru.blesshost.com",
defaultLocale: "ru",
},
{
domain: "zh.blesshost.com",
defaultLocale: "zh",
},
],
},
images: {
domains: [
"blog.blesshost.com",
"secure.gravatar.com",
"images.unsplash.com",
"cdn.sanity.io",
],
},
redirects: () => [OG_REWRITE],
rewrites: () => [STUDIO_REWRITE],
eslint: {
// Warning: Dangerously allow production builds to successfully complete even if
// your project has ESLint errors.
ignoreDuringBuilds: true,
},
webpack(config, { isServer }) {
if (isServer) {
require("./scripts/generate-sitemap");
generateRobotsTxt();
}
return config;
},
});