next.config.js 1.3 KB

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