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.

next.config.js 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. /** @type {import('next').NextConfig} */
  16. const nextConfig = {
  17. basePath,
  18. assetPrefix,
  19. webpack: (config, { dev, isServer }) => {
  20. config.plugins.push(codeInspectorPlugin({ bundler: 'webpack' }))
  21. return config
  22. },
  23. productionBrowserSourceMaps: false, // enable browser source map generation during the production build
  24. // Configure pageExtensions to include md and mdx
  25. pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
  26. experimental: {
  27. },
  28. // fix all before production. Now it slow the develop speed.
  29. eslint: {
  30. // Warning: This allows production builds to successfully complete even if
  31. // your project has ESLint errors.
  32. ignoreDuringBuilds: true,
  33. dirs: ['app', 'bin', 'config', 'context', 'hooks', 'i18n', 'models', 'service', 'test', 'types', 'utils'],
  34. },
  35. typescript: {
  36. // https://nextjs.org/docs/api-reference/next.config.js/ignoring-typescript-errors
  37. ignoreBuildErrors: true,
  38. },
  39. reactStrictMode: true,
  40. async redirects() {
  41. return [
  42. {
  43. source: '/',
  44. destination: '/apps',
  45. permanent: false,
  46. },
  47. ]
  48. },
  49. output: 'standalone',
  50. }
  51. module.exports = withMDX(nextConfig)