-
Notifications
You must be signed in to change notification settings - Fork 20
/
next.config.mjs
83 lines (80 loc) · 2.05 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
import nextMDX from "@next/mdx";
import withPlugins from "next-compose-plugins";
import withTM from "next-transpile-modules";
import path from "path";
import remarkGfm from "remark-gfm";
const withMDX = nextMDX({
extension: /\.mdx?$/,
options: {
rehypePlugins: [],
remarkPlugins: [remarkGfm],
},
});
const ESM_PACKAGES = [
"axios",
"@databiosphere/findable-ui",
"@tanstack/react-table",
];
export default withPlugins(
[
[
withMDX,
{
pageExtensions: ["md", "mdx", "ts", "tsx"],
},
],
[withTM(["echarts", "zrender"])],
],
{
images: {
unoptimized: true,
},
output: "export",
reactStrictMode: true,
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["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["uuid"] = path.resolve(
process.cwd(),
"node_modules/uuid"
);
return config;
},
}
);