-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnext.config.js
44 lines (38 loc) · 961 Bytes
/
next.config.js
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
const { PHASE_DEVELOPMENT_SERVER } = require("next/constants");
const { getConfig } = require("./src/lib/build/config.ts");
module.exports = (phase) => {
const isDev = phase === PHASE_DEVELOPMENT_SERVER;
const config = getConfig(undefined, isDev);
const url = isDev ? `http://localhost:5001` : process.env.NEXT_PUBLIC_URL;
const basePath = isDev ? `` : process.env.NEXT_PUBLIC_BASE_PATH;
const baseUrl = basePath ? `${url}${basePath}` : url;
const assetPrefix = basePath;
const env = {
CANOPY_CONFIG: {
...config,
url,
assetPrefix,
basePath,
baseUrl,
},
};
const redirects = () => {
return [
{
source: "/works",
destination: "/search",
permanent: true,
},
];
};
return {
env,
assetPrefix,
basePath,
pageExtensions: ["ts", "tsx", "js", "jsx", "md", "mdx"],
redirects,
typescript: {
ignoreBuildErrors: true,
},
};
};