next.config.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import type { NextConfig } from "next";
  2. // import createMDX from '@next/mdx';
  3. import createNextIntlPlugin from 'next-intl/plugin';
  4. const withNextIntl = createNextIntlPlugin();
  5. const nextConfig: NextConfig = {
  6. // pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'],
  7. // output: 'export',
  8. distDir: './dist',
  9. // 防止dev模式下模拟立即卸载组件和重新挂载组件的行为
  10. reactStrictMode: false,
  11. images: {
  12. remotePatterns: [
  13. {
  14. protocol: 'https',
  15. hostname: 'usky.cn',
  16. pathname: '/assets/**',
  17. },
  18. ],
  19. },
  20. eslint: {
  21. // 忽略构建时的 ESLint 错误(第三方库可能有配置问题)
  22. ignoreDuringBuilds: true,
  23. },
  24. webpack: (config, { isServer }) => {
  25. // 确保 MediaPipe 模块在客户端正确加载
  26. if (!isServer) {
  27. config.resolve.fallback = {
  28. ...config.resolve.fallback,
  29. fs: false,
  30. path: false,
  31. crypto: false,
  32. };
  33. }
  34. return config;
  35. },
  36. };
  37. // const withMDX = createMDX({
  38. // // Add markdown plugins here, as desired
  39. // })
  40. // export default withMDX(withNextIntl(nextConfig));
  41. export default withNextIntl(nextConfig);