next.config.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. export default {
  2. reactStrictMode: true,
  3. pageExtensions: ["ts", "tsx", "mdx"],
  4. logging: {
  5. fetches: {
  6. fullUrl: true,
  7. },
  8. },
  9. webpack(config) {
  10. config.module.rules.push({
  11. test: /\.svg$/i,
  12. use: ["@svgr/webpack"],
  13. });
  14. config.resolve.extensionAlias = {
  15. ".js": [".js", ".ts", ".tsx"],
  16. };
  17. return config;
  18. },
  19. transpilePackages: ["@pythnetwork/*"],
  20. headers: () => [
  21. {
  22. source: "/:path*",
  23. headers: [
  24. {
  25. key: "X-XSS-Protection",
  26. value: "1; mode=block",
  27. },
  28. {
  29. key: "Referrer-Policy",
  30. value: "strict-origin-when-cross-origin",
  31. },
  32. {
  33. key: "Strict-Transport-Security",
  34. value: "max-age=2592000",
  35. },
  36. {
  37. key: "X-Content-Type-Options",
  38. value: "nosniff",
  39. },
  40. {
  41. key: "Permissions-Policy",
  42. value:
  43. "vibrate=(), geolocation=(), midi=(), notifications=(), push=(), sync-xhr=(), microphone=(), camera=(), magnetometer=(), gyroscope=(), speaker=(), vibrate=(), fullscreen=self",
  44. },
  45. ],
  46. },
  47. ],
  48. rewrites: () => [
  49. {
  50. source: "/api/publishers-ranking",
  51. destination:
  52. "https://web-api.pyth.network/publishers_ranking?cluster=pythnet",
  53. },
  54. ],
  55. redirects: () => [
  56. {
  57. source: "/test",
  58. destination: "https://staking-legacy.pyth.network/test",
  59. permanent: false,
  60. },
  61. ],
  62. };