-
Notifications
You must be signed in to change notification settings - Fork 8
/
next.config.mjs
97 lines (93 loc) · 2.01 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
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
import bundleAnalyser from "@next/bundle-analyzer";
import createNextPluginPreval from "next-plugin-preval/config.js";
const withNextPluginPreval = createNextPluginPreval();
/** @type {import('next').NextConfig} */
const config = {
poweredByHeader: false,
images: {
deviceSizes: [384, 640, 750, 828, 1080, 1200, 1920, 2048, 3840],
minimumCacheTTL: 60,
remotePatterns: [
{
protocol: "https",
hostname: "assets.tina.io",
port: "",
},
{
protocol: "https",
hostname: "i.ytimg.com",
port: "",
},
{
protocol: "https",
hostname: "img.youtube.com",
port: "",
},
{
protocol: "https",
hostname: "**ssw.com.au",
port: "",
},
{
protocol: "http",
hostname: "**ssw.com.au",
port: "",
},
{
protocol: "https",
hostname: "i.vimeocdn.com",
port: "",
},
{
protocol: "https",
hostname: "secure-content.meetupstatic.com",
port: "",
},
],
},
output: "standalone", // required for Docker support
webpack(config) {
config.module.rules.push({
test: /\.svg$/i,
issuer: /\.[jt]sx?$/,
use: ["@svgr/webpack"],
});
return config;
},
async rewrites() {
return [
{
source: "/",
destination: "/home",
},
];
},
async redirects() {
return [
{
source: "/admin",
destination: "/admin/index.html",
permanent: true,
},
];
},
experimental: {
optimizePackageImports: ["tinacms", "@fortawesome/fontawesome-svg-core"],
turbo: {
resolveExtensions: [
".mdx",
".tsx",
".ts",
".jsx",
".js",
".mjs",
".json",
],
},
},
productionBrowserSourceMaps: true,
};
const withBundleAnalyzer = bundleAnalyser({
enabled: process.env.BUNDLE_ANALYSE === "true",
});
export default withNextPluginPreval(withBundleAnalyzer(config));