next.config.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. hideSourceMaps: true
  34. },
  35. async redirects() {
  36. return [
  37. {
  38. source: '/',
  39. destination: '/apps',
  40. permanent: false,
  41. },
  42. ]
  43. },
  44. }
  45. // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup
  46. const sentryWebpackPluginOptions = {
  47. org: "perfectworld",
  48. project: "javascript-nextjs",
  49. silent: true, // Suppresses all logs
  50. sourcemaps: {
  51. assets: "./**",
  52. ignore: ["./node_modules/**"],
  53. },
  54. // https://github.com/getsentry/sentry-webpack-plugin#options.
  55. }
  56. module.exports = withMDX(withSentryConfig(nextConfig, sentryWebpackPluginOptions))