-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
63 lines (55 loc) · 1.47 KB
/
next.config.js
File metadata and controls
63 lines (55 loc) · 1.47 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/** @type {import('next').NextConfig} */
module.exports = (phase, { defaultConfig }) => {
const nextConfig = {
// ...defaultConfig,
reactStrictMode: true,
swcMinify: true,
basePath: "/github-api",
typescript: {
// !! WARN !!
// Dangerously allow production builds to successfully complete even if
// your project has type errors.
// !! WARN !!
ignoreBuildErrors: true,
},
eslint: {
// Warning: This allows production builds to successfully complete even if
// your project has ESLint errors.
ignoreDuringBuilds: true,
},
};
// fs 모듈 in browser 문제 해결
nextConfig.webpack5 = true;
nextConfig.webpack = (config) => {
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
};
return config;
};
if (process.env.MODE == null || process.env.MODE === "") {
return nextConfig;
}
console.log("TEST 모드입니다.");
delete nextConfig.basePath;
nextConfig.trailingSlash = true;
nextConfig.rewrites = () => {
const TEST_BASE_URL =
process.env.TEST_BASE_URL ?? "https://www.creco.services";
return [
{
source: "/memory-map/",
destination: `${TEST_BASE_URL}/memory-map/`,
},
{
source: "/memory-map/:slug*",
destination: `${TEST_BASE_URL}/memory-map/:slug*`,
},
{
source: "/github-api/:slug*",
destination: "/:slug*",
},
];
};
return nextConfig;
};