next.config.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. const { codeInspectorPlugin } = require('code-inspector-plugin')
  2. const withMDX = require('@next/mdx')({
  3. extension: /\.mdx?$/,
  4. options: {
  5. // If you use remark-gfm, you'll need to use next.config.mjs
  6. // as the package is ESM only
  7. // https://github.com/remarkjs/remark-gfm#install
  8. remarkPlugins: [],
  9. rehypePlugins: [],
  10. // If you use `MDXProvider`, uncomment the following line.
  11. // providerImportSource: "@mdx-js/react",
  12. },
  13. })
  14. /** @type {import('next').NextConfig} */
  15. const nextConfig = {
  16. webpack: (config, { dev, isServer }) => {
  17. config.plugins.push(codeInspectorPlugin({ bundler: 'webpack' }))
  18. return config
  19. },
  20. productionBrowserSourceMaps: false, // enable browser source map generation during the production build
  21. // Configure pageExtensions to include md and mdx
  22. pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
  23. experimental: {
  24. },
  25. // fix all before production. Now it slow the develop speed.
  26. eslint: {
  27. // Warning: This allows production builds to successfully complete even if
  28. // your project has ESLint errors.
  29. ignoreDuringBuilds: true,
  30. dirs: ['app', 'bin', 'config', 'context', 'hooks', 'i18n', 'models', 'service', 'test', 'types', 'utils'],
  31. },
  32. typescript: {
  33. // https://nextjs.org/docs/api-reference/next.config.js/ignoring-typescript-errors
  34. ignoreBuildErrors: true,
  35. },
  36. reactStrictMode: true,
  37. async redirects() {
  38. return [
  39. {
  40. source: '/',
  41. destination: '/apps',
  42. permanent: false,
  43. },
  44. ]
  45. },
  46. output: 'standalone',
  47. }
  48. module.exports = withMDX(nextConfig)