next.config.ts 718 B

12345678910111213141516171819202122
  1. import type { NextConfig } from 'next'
  2. console.log('SOL_ENDPOINT', process.env.SOL_ENDPOINT)
  3. const nextConfig: NextConfig = {
  4. output: 'standalone',
  5. // 防止 bn.js 和 Solana 相关包在服务端被 Turbopack 打包,
  6. // 避免 BN 实例跨 chunk 时出现 _bn 属性访问错误
  7. serverExternalPackages: [
  8. 'bn.js',
  9. '@solana/web3.js',
  10. '@coral-xyz/anchor',
  11. ],
  12. // 忽略构建时的类型错误(因为 lib 目录是第三方代码,可能有类型问题)
  13. typescript: {
  14. // 设置为 true 会忽略所有类型错误,包括项目代码
  15. // 如果只想忽略 lib 目录,可以保持 false,但需要在 tsconfig.json 中正确排除
  16. ignoreBuildErrors: true,
  17. },
  18. }
  19. export default nextConfig