next.config.js 621 B

12345678910111213141516171819202122232425
  1. const withMarkdoc = require("@markdoc/next.js")
  2. const previousDocsRedirects = require("./previous-docs-redirects")
  3. module.exports = withMarkdoc(/* config: https://markdoc.io/docs/nextjs#options */)({
  4. pageExtensions: ["js", "jsx", "ts", "tsx", "md", "mdoc"],
  5. basePath: "/docs",
  6. turbopack: {},
  7. experimental: {
  8. instrumentationHook: true,
  9. },
  10. async redirects() {
  11. return [...previousDocsRedirects]
  12. },
  13. async rewrites() {
  14. return {
  15. beforeFiles: [
  16. {
  17. // Rewrite /docs/llms.txt to the API endpoint (internal to basePath)
  18. source: "/llms.txt",
  19. destination: "/api/llms.txt",
  20. },
  21. ],
  22. }
  23. },
  24. })