2023-03-07 23:23:54 +08:00
|
|
|
/** @type {import('next').NextConfig} */
|
2023-03-13 03:06:21 +08:00
|
|
|
|
2023-03-13 03:21:48 +08:00
|
|
|
const nextConfig = {
|
2023-03-07 23:23:54 +08:00
|
|
|
experimental: {
|
|
|
|
appDir: true,
|
|
|
|
},
|
2023-05-03 23:49:33 +08:00
|
|
|
async rewrites() {
|
|
|
|
const ret = [];
|
|
|
|
|
|
|
|
const apiUrl = process.env.API_URL;
|
|
|
|
if (apiUrl) {
|
|
|
|
console.log("[Next] using api url ", apiUrl);
|
|
|
|
ret.push({
|
|
|
|
source: "/api/:path*",
|
|
|
|
destination: `${apiUrl}/:path*`,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
},
|
2023-03-10 01:01:40 +08:00
|
|
|
webpack(config) {
|
|
|
|
config.module.rules.push({
|
|
|
|
test: /\.svg$/,
|
|
|
|
use: ["@svgr/webpack"],
|
2023-04-11 01:21:34 +08:00
|
|
|
});
|
2023-03-07 23:23:54 +08:00
|
|
|
|
2023-03-10 01:01:40 +08:00
|
|
|
return config;
|
2023-04-11 01:21:34 +08:00
|
|
|
},
|
|
|
|
output: "standalone",
|
2023-03-13 03:21:48 +08:00
|
|
|
};
|
2023-03-10 01:01:40 +08:00
|
|
|
|
2023-05-03 23:08:37 +08:00
|
|
|
export default nextConfig;
|