next.config.js 759 B

123456789101112131415161718192021222324
  1. /** @type {import('next').NextConfig} */
  2. const nextConfig = {
  3. output: "standalone",
  4. // Keep internal locale rewrites on the original origin, including 127.0.0.1 previews in Next 14.
  5. skipMiddlewareUrlNormalize: true,
  6. async headers() {
  7. return ['admin', 'dashboard', 'login', 'payment', 'create-order'].flatMap(segment => [
  8. `/${segment}/:path*`, `/:locale(de|fr|es|it|pt|zh)/${segment}/:path*`,
  9. ].map(source => ({ source, headers: [{ key: 'X-Robots-Tag', value: 'noindex, nofollow' }] })));
  10. },
  11. async rewrites() {
  12. return [
  13. {
  14. source: '/api/:path*',
  15. destination: `${process.env.NEXT_PUBLIC_API_URL}/api/:path*`,
  16. },
  17. ];
  18. },
  19. eslint: {
  20. ignoreDuringBuilds: true,
  21. },
  22. };
  23. module.exports = nextConfig;