next.config.ts 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. import type { NextConfig } from "next";
  2. /**
  3. * @briven/auth: package exports are fixed to dist/ after install
  4. * (see scripts/fix-briven-auth-exports.mjs). Do not alias "@briven/auth"
  5. * alone — webpack treats it as a prefix and breaks "@briven/auth/react".
  6. */
  7. const nextConfig: NextConfig = {
  8. transpilePackages: ["@briven/auth", "@krypco/mavi-core"],
  9. // Local dev: allow both localhost and 127.0.0.1
  10. allowedDevOrigins: ["127.0.0.1", "localhost"],
  11. // Tree-shake heavy wallet packages (Phase 6 light performance)
  12. experimental: {
  13. optimizePackageImports: ["wagmi", "viem", "@wagmi/connectors"],
  14. },
  15. async redirects() {
  16. return [
  17. // Old / alternate magic-link paths → verify landing
  18. {
  19. source: "/verify",
  20. destination: "/auth/verify",
  21. permanent: false,
  22. },
  23. {
  24. source: "/login/verify",
  25. destination: "/auth/verify",
  26. permanent: false,
  27. },
  28. {
  29. source: "/explorer",
  30. destination: "/portal/explorer",
  31. permanent: false,
  32. },
  33. {
  34. source: "/architecture",
  35. destination: "/portal/architecture",
  36. permanent: false,
  37. },
  38. {
  39. source: "/connect-wallet",
  40. destination: "/portal/connect-wallet",
  41. permanent: false,
  42. },
  43. {
  44. source: "/dashboard",
  45. destination: "/portal/dashboard",
  46. permanent: false,
  47. },
  48. {
  49. source: "/docs",
  50. destination: "/portal/docs",
  51. permanent: false,
  52. },
  53. {
  54. source: "/services",
  55. destination: "/portal/services",
  56. permanent: false,
  57. },
  58. {
  59. source: "/mavi",
  60. destination: "/portal/mavi",
  61. permanent: false,
  62. },
  63. {
  64. source: "/mavi/create",
  65. destination: "/portal/mavi/create",
  66. permanent: false,
  67. },
  68. {
  69. source: "/mavi/import",
  70. destination: "/portal/mavi/import",
  71. permanent: false,
  72. },
  73. {
  74. source: "/mavi/send",
  75. destination: "/portal/mavi/send",
  76. permanent: false,
  77. },
  78. {
  79. source: "/mavi/receive",
  80. destination: "/portal/mavi/receive",
  81. permanent: false,
  82. },
  83. {
  84. source: "/mavi/activity",
  85. destination: "/portal/mavi/activity",
  86. permanent: false,
  87. },
  88. ];
  89. },
  90. };
  91. export default nextConfig;