/
next.config.js
105 lines (100 loc) · 2.46 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
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
const { withSuperjson } = require("next-superjson");
const withRpc = require("next-rpc")();
require("eslint-config-next/parser");
// @ts-check
/**
* @type {import('next').NextConfig}
**/
module.exports = withSuperjson()({
webpack(config, options) {
if (process.env.ANALYZE) {
config.plugins.push(new withRpc("stats.txt"));
}
// config.context = join(process.cwd(), "./");
config.experiments = config.experiments || {};
config.experiments.topLevelAwait = true;
config.module.rules.push({
test: /\.graphql$/,
exclude: /node_modules/,
use: [options.defaultLoaders.babel, { loader: "graphql-let/loader" }]
});
config.module.rules.push({
test: /\.graphqls$/,
exclude: /node_modules/,
use: ["graphql-let/schema/loader"]
});
config.module.rules.push({
test: /\.ya?ml$/,
type: "json",
use: "yaml-loader"
});
return config;
},
async headers() {
return [
{
source: "/fonts/inter-var-latin.woff2",
headers: [
{
key: "Cache-Control",
value: "public, max-age=31536000, immutable"
}
]
}
];
},
reactStrictMode: true,
swcMinify: true,
sourceMaps: {
productionBrowserSourceMaps: true
},
experimental: {
outputStandalone: true
},
i18n: {
locales: ["en-US"],
defaultLocale: "en-US",
domains: [
{
domain: "www.andrewross.tech",
defaultLocale: "en-US"
}
]
},
images: {
formats: ["image/avif", "image/webp"],
domains: [
"secure.gravatar.com",
"pbs.twimg.com",
"en.gravatar.com",
"www.andrewross.engineer",
"www.andrewross.tech",
"andrewross.tech",
"andrewross.engineer",
"www.asrossheadless.wpengine.com",
"asrossheadless.wpengine.com",
"c.tenor.com",
"unsplash.com",
"images.unsplash.com",
"tailwindui.com",
"avatars.githubusercontent.com",
"gravatar.com",
"images.unsplash.com",
"lh3.googleusercontent.com",
"wpengine.com",
"placeimage.com",
"andrewross.app",
"www.andrewross.app",
"placeimg.com",
"github.githubassets.com",
"api.github.com",
"dev-to-uploads.s3.amazonaws.com",
"repository-images.githubusercontent.com",
"i0.wp.com",
"i1.wp.com",
"i2.wp.com",
"www.facebook.com"
]
}
});
console.log("[next.config.js]: ", JSON.stringify(module.exports, null, 2));