next.config.js 1.1 KB

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