-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
37 lines (35 loc) · 963 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
/** @type {import('next').NextConfig} */
const domain = process.env.NEXT_PUBLIC_ROOT_DOMAIN;
const protocol = process.env.NEXT_PUBLIC_PROTOCOL;
const apiPrefix = process.env.NEXT_PUBLIC_API_PREFIX;
const nextConfig = {
reactStrictMode: true,
images: {
domains: [],
formats: ["image/avif", "image/webp"],
},
async rewrites() {
return [
{
source: "/api/:path*",
destination: domain
? `${protocol}://api.${domain}/${apiPrefix}/:path*`
: "http://localhost:8000/api/:path*",
},
];
},
webpack: (config, { webpack }) => {
config.externals.push({
"utf-8-validate": "commonjs utf-8-validate",
bufferutil: "commonjs bufferutil",
"supports-color": "commonjs supports-color",
});
config.plugins.push(
new webpack.IgnorePlugin({
resourceRegExp: /import2/, // adjust the module name
})
);
return config;
},
};
module.exports = nextConfig;