next.config.mjs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import { withContentlayer } from "next-contentlayer"
  2. import fs from 'fs-extra'
  3. /** @type {import('next').NextConfig} */
  4. const nextConfig = {
  5. reactStrictMode: true,
  6. images: {
  7. domains: ["avatars.githubusercontent.com"],
  8. },
  9. experimental: {
  10. appDir: true
  11. },
  12. async redirects() {
  13. return JSON.parse(fs.readFileSync('./redirects.json'))
  14. },
  15. }
  16. export default withContentlayer(nextConfig)
  17. // import nextMDX from '@next/mdx'
  18. // import { remarkPlugins } from './mdx/remark.mjs'
  19. // import { rehypePlugins } from './mdx/rehype.mjs'
  20. // import { recmaPlugins } from './mdx/recma.mjs'
  21. // import fs from 'fs-extra'
  22. // const redirects = JSON.parse(fs.readFileSync('./redirects.json'))
  23. // /** @type {import('next').NextConfig} */
  24. // const withMDX = nextMDX({
  25. // extension: /\.mdx?$/,
  26. // options: {
  27. // providerImportSource: '@mdx-js/react',
  28. // remarkPlugins,
  29. // rehypePlugins,
  30. // recmaPlugins
  31. // }
  32. // })
  33. // const nextConfig = {
  34. // reactStrictMode: false,
  35. // swcMinify: true,
  36. // pageExtensions: ['js', 'jsx', 'md', 'mdx', 'mdoc'],
  37. // images: {
  38. // imageSizes: [48, 96, 286, 480, 510, 552, 556, 572, 960, 1020, 1040, 1112, 2080]
  39. // },
  40. // async redirects() {
  41. // return redirects
  42. // },
  43. // webpack(config, options) {
  44. // config.resolve = {
  45. // ...config.resolve,
  46. // fallback: {
  47. // fs: false,
  48. // path: false,
  49. // os: false
  50. // }
  51. // }
  52. // return config
  53. // }
  54. // }
  55. // export default withMDX(nextConfig)