next.config.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. const config = {
  2. reactStrictMode: true,
  3. pageExtensions: ["ts", "tsx", "mdx"],
  4. experimental: {
  5. useCache: true,
  6. },
  7. logging: {
  8. fetches: {
  9. fullUrl: true,
  10. },
  11. },
  12. webpack(config) {
  13. config.module.rules.push({
  14. test: /\.svg$/i,
  15. use: ["@svgr/webpack"],
  16. });
  17. config.resolve.extensionAlias = {
  18. ".js": [".js", ".ts", ".tsx"],
  19. };
  20. return config;
  21. },
  22. headers: async () => [
  23. {
  24. source: "/:path*",
  25. headers: [
  26. {
  27. key: "X-XSS-Protection",
  28. value: "1; mode=block",
  29. },
  30. {
  31. key: "Referrer-Policy",
  32. value: "strict-origin-when-cross-origin",
  33. },
  34. {
  35. key: "Strict-Transport-Security",
  36. value: "max-age=2592000",
  37. },
  38. {
  39. key: "X-Content-Type-Options",
  40. value: "nosniff",
  41. },
  42. {
  43. key: "Permissions-Policy",
  44. value:
  45. "vibrate=(), geolocation=(), midi=(), notifications=(), push=(), sync-xhr=(), microphone=(), camera=(), magnetometer=(), gyroscope=(), speaker=(), vibrate=(), fullscreen=self",
  46. },
  47. ],
  48. },
  49. ],
  50. };
  51. export default config;