-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.mjs
106 lines (103 loc) · 2.72 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
98
99
100
101
102
103
104
105
106
import nextMDX from "@next/mdx";
import withPlugins from "next-compose-plugins";
import path from "path";
const ESM_PACKAGES = [
"axios",
"codsen-utils",
"lodash-es",
"ranges-apply",
"ranges-merge",
"ranges-push",
"ranges-sort",
"string-collapse-leading-whitespace",
"string-left-right",
"string-strip-html",
"@databiosphere/findable-ui",
"@tanstack/react-table",
];
const withMDX = nextMDX({
extension: /\.mdx?$/,
});
export default withPlugins(
[[withMDX, { pageExtensions: ["md", "mdx", "ts", "tsx"] }]],
{
basePath: "",
experimental: {
instrumentationHook: true,
},
images: {
unoptimized: true,
},
reactStrictMode: true,
async redirects() {
return [
{
destination: "/reports",
permanent: true,
source: "/tasks",
},
];
},
transpilePackages: [...ESM_PACKAGES],
webpack: (config) => {
// Add the alias for the peer dependency
config.resolve.alias["@emotion/react"] = path.resolve(
process.cwd(),
"node_modules/@emotion/react"
);
config.resolve.alias["@emotion/styled"] = path.resolve(
process.cwd(),
"node_modules/@emotion/styled"
);
config.resolve.alias["@mui/icons-material"] = path.resolve(
process.cwd(),
"node_modules/@mui/icons-material"
);
config.resolve.alias["@mui/material"] = path.resolve(
process.cwd(),
"node_modules/@mui/material"
);
config.resolve.alias["react-dropzone"] = path.resolve(
process.cwd(),
"node_modules/react-dropzone"
);
config.resolve.alias["isomorphic-dompurify"] = path.resolve(
process.cwd(),
"node_modules/isomorphic-dompurify"
);
config.resolve.alias["match-sorter"] = path.resolve(
process.cwd(),
"node_modules/match-sorter"
);
config.resolve.alias["next"] = path.resolve(
process.cwd(),
"node_modules/next"
);
config.resolve.alias["react"] = path.resolve(
process.cwd(),
"node_modules/react"
);
config.resolve.alias["react-dom"] = path.resolve(
process.cwd(),
"node_modules/react-dom"
);
config.resolve.alias["react-gtm-module"] = path.resolve(
process.cwd(),
"node_modules/react-gtm-module"
);
config.resolve.alias["react-window"] = path.resolve(
process.cwd(),
"node_modules/react-window"
);
config.resolve.alias["uuid"] = path.resolve(
process.cwd(),
"node_modules/uuid"
);
config.resolve.alias["validate.js"] = path.resolve(
process.cwd(),
"node_modules/validate.js"
);
return config;
},
}
);