next.config.mjs 574 B

1234567891011121314151617181920212223242526272829303132
  1. /** @type {import('next').NextConfig} */
  2. const nextConfig = {
  3. experimental: {
  4. appDir: true,
  5. },
  6. async rewrites() {
  7. const ret = [];
  8. const apiUrl = process.env.API_URL;
  9. if (apiUrl) {
  10. console.log("[Next] using api url ", apiUrl);
  11. ret.push({
  12. source: "/api/:path*",
  13. destination: `${apiUrl}/:path*`,
  14. });
  15. }
  16. return ret;
  17. },
  18. webpack(config) {
  19. config.module.rules.push({
  20. test: /\.svg$/,
  21. use: ["@svgr/webpack"],
  22. });
  23. return config;
  24. },
  25. output: "standalone",
  26. };
  27. export default nextConfig;