-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.mjs
60 lines (57 loc) · 1.49 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
import createMDX from "@next/mdx";
/** @type {import("next").NextConfig} */
const nextConfig = {
output: "standalone",
pageExtensions: ["js", "jsx", "md", "mdx", "ts", "tsx"],
productionBrowserSourceMaps: true,
trailingSlash: false,
async redirects() {
return [
{
source: "/overview",
destination: "/",
permanent: false,
},
{
source: "/task/:name/statement",
destination: "/task/:name",
permanent: false,
},
{
source: "/user/:username/profile",
destination: "/user/:username",
permanent: false,
},
{
source: "/user/:username/edit",
destination: "/user/:username/edit/password",
permanent: false,
},
];
},
async rewrites() {
return [
{
source: "/api/:path*",
destination: "https://training.olinfo.it/api/:path*",
},
{
source: "/api-terry/:path*",
destination: "https://territoriali.olinfo.it/:path*",
},
];
},
webpack: (config) => {
config.resolve.alias.canvas = false;
if (config.target[0] === "web") {
config.target[1] = "es2022";
}
return config;
},
experimental: {
swcPlugins: [["@lingui/swc-plugin", {}]],
},
// https://github.com/wojtekmaj/react-pdf/wiki/Upgrade-guide-from-version-8.x-to-9.x#applications-using-older-versions-of-nextjs-may-require-a-workaround
swcMinify: false,
};
export default createMDX({ extension: /\.mdx?$/ })(nextConfig);