NextChat-U/next.config.mjs

35 lines
601 B
JavaScript
Raw Normal View History

2023-03-08 00:23:54 +09:00
/** @type {import('next').NextConfig} */
2023-03-13 04:06:21 +09:00
2023-03-13 04:21:48 +09:00
const nextConfig = {
2023-03-08 00:23:54 +09:00
experimental: {
appDir: true,
},
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*`,
});
}
2023-05-04 23:18:03 +09:00
return {
afterFiles: ret,
};
},
2023-03-10 02:01:40 +09:00
webpack(config) {
config.module.rules.push({
test: /\.svg$/,
use: ["@svgr/webpack"],
2023-04-11 02:21:34 +09:00
});
2023-03-08 00:23:54 +09:00
2023-03-10 02:01:40 +09:00
return config;
2023-04-11 02:21:34 +09:00
},
output: "standalone",
2023-03-13 04:21:48 +09:00
};
2023-03-10 02:01:40 +09:00
2023-05-04 00:08:37 +09:00
export default nextConfig;