next.config.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. const { withSentryConfig } = require("@sentry/nextjs")
  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. productionBrowserSourceMaps: false, // enable browser source map generation during the production build
  17. // Configure pageExtensions to include md and mdx
  18. pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
  19. experimental: {
  20. appDir: true,
  21. },
  22. // fix all before production. Now it slow the develop speed.
  23. eslint: {
  24. // Warning: This allows production builds to successfully complete even if
  25. // your project has ESLint errors.
  26. ignoreDuringBuilds: true,
  27. },
  28. typescript: {
  29. // https://nextjs.org/docs/api-reference/next.config.js/ignoring-typescript-errors
  30. ignoreBuildErrors: true,
  31. },
  32. sentry: {},
  33. async redirects() {
  34. return [
  35. {
  36. source: '/',
  37. destination: '/apps',
  38. permanent: false,
  39. },
  40. ]
  41. },
  42. }
  43. // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup
  44. const sentryWebpackPluginOptions = {
  45. org: "perfectworld",
  46. project: "javascript-nextjs",
  47. silent: true, // Suppresses all logs
  48. sourcemaps: {
  49. assets: "./**",
  50. ignore: ["./node_modules/**"],
  51. },
  52. // https://github.com/getsentry/sentry-webpack-plugin#options.
  53. }
  54. module.exports = withMDX(withSentryConfig(nextConfig, sentryWebpackPluginOptions))