-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathnext.config.js
More file actions
45 lines (43 loc) · 1.05 KB
/
next.config.js
File metadata and controls
45 lines (43 loc) · 1.05 KB
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
const fs = require("fs");
const withTM = require("next-transpile-modules")([
"@mui/material",
"@mui/system",
"@mui/icons-material",
"@mui/x-data-grid",
"@mui/utils",
]);
/** @type {import('next').NextConfig} */
const nextConfig = {
basePath: process.env.MULTIMOCO_STATIC_BUILD? "/multimoco-web": "",
typescript: {
ignoreBuildErrors: true,
},
reactStrictMode: false,
swcMinify: true,
exportPathMap: async function (defaultPathMap, args) {
const pathMap = {
"/video": { page: '/video' },
...Object.fromEntries(
fs.readdirSync("pages/search_static")
.map((x) => {
const fname = x.replace(".tsx", "");
return ["/" + fname, { page: "/search_static/" + fname }]
}))
};
console.log(pathMap);
return pathMap
},
redirects: async function () {
return [
{
source: '/',
destination: '/index.html',
permanent: true
}
]
},
generateBuildId: async () => {
return 'multimoco-build-id'
}
}
module.exports = withTM(nextConfig)