You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. const { basePath, assetPrefix } = require('./utils/var-basePath')
  2. const { codeInspectorPlugin } = require('code-inspector-plugin')
  3. const withMDX = require('@next/mdx')({
  4. extension: /\.mdx?$/,
  5. options: {
  6. // If you use remark-gfm, you'll need to use next.config.mjs
  7. // as the package is ESM only
  8. // https://github.com/remarkjs/remark-gfm#install
  9. remarkPlugins: [],
  10. rehypePlugins: [],
  11. // If you use `MDXProvider`, uncomment the following line.
  12. // providerImportSource: "@mdx-js/react",
  13. },
  14. })
  15. // the default url to prevent parse url error when running jest
  16. const remoteImageURL = new URL(`${process.env.NEXT_PUBLIC_WEB_PREFIX || 'http://localhost:3000'}/**`)
  17. /** @type {import('next').NextConfig} */
  18. const nextConfig = {
  19. basePath,
  20. assetPrefix,
  21. webpack: (config, { dev, isServer }) => {
  22. config.plugins.push(codeInspectorPlugin({ bundler: 'webpack' }))
  23. return config
  24. },
  25. productionBrowserSourceMaps: false, // enable browser source map generation during the production build
  26. // Configure pageExtensions to include md and mdx
  27. pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
  28. // https://nextjs.org/docs/messages/next-image-unconfigured-host
  29. images: {
  30. remotePatterns: [{
  31. protocol: remoteImageURL.protocol.replace(':', ''),
  32. hostname: remoteImageURL.hostname,
  33. port: remoteImageURL.port,
  34. pathname: remoteImageURL.pathname,
  35. search: '',
  36. }],
  37. },
  38. experimental: {
  39. },
  40. // fix all before production. Now it slow the develop speed.
  41. eslint: {
  42. // Warning: This allows production builds to successfully complete even if
  43. // your project has ESLint errors.
  44. ignoreDuringBuilds: true,
  45. dirs: ['app', 'bin', 'config', 'context', 'hooks', 'i18n', 'models', 'service', 'test', 'types', 'utils'],
  46. },
  47. typescript: {
  48. // https://nextjs.org/docs/api-reference/next.config.js/ignoring-typescript-errors
  49. ignoreBuildErrors: true,
  50. },
  51. reactStrictMode: true,
  52. async redirects() {
  53. return [
  54. {
  55. source: '/',
  56. destination: '/apps',
  57. permanent: false,
  58. },
  59. ]
  60. },
  61. output: 'standalone',
  62. }
  63. module.exports = withMDX(nextConfig)