/** @type {import('next').NextConfig} */

const nextConfig = {
  reactStrictMode: true,
  // Fix for Next.js 13+ Turbopack in monorepos to correctly identify the workspace root
  outputFileTracingRoot: '../../',
  images: {
    remotePatterns: [
      {
        protocol: 'https',
        hostname: 'placehold.co',
      },
      {
        protocol: 'https',
        hostname: 'picsum.photos',
      },
    ],
  },
  typescript: {
    ignoreBuildErrors: false,
  },
  transpilePackages: [
    '@core/racing',
    '@core/identity',
    '@core/social'
  ],
  webpack: (config) => {
    config.module.rules.push({
      test: /\.(mp4|webm)$/,
      type: 'asset/resource',
    });

    return config;
  },
};

export default nextConfig;