import type { NextConfig } from "next";

const nextConfig: NextConfig = {
  transpilePackages: ['@tldraw/tldraw'],
  eslint: { ignoreDuringBuilds: true },
  typescript: { ignoreBuildErrors: true },
  webpack: (config, { isServer }) => {
    // Fix tldraw duplication issues
    config.resolve.alias = {
      ...config.resolve.alias,
      '@tldraw/utils': require.resolve('@tldraw/utils'),
      '@tldraw/state': require.resolve('@tldraw/state'),
      '@tldraw/state-react': require.resolve('@tldraw/state-react'),
      '@tldraw/store': require.resolve('@tldraw/store'),
      '@tldraw/validate': require.resolve('@tldraw/validate'),
      '@tldraw/tlschema': require.resolve('@tldraw/tlschema'),
      '@tldraw/editor': require.resolve('@tldraw/editor'),
    };
    
    return config;
  },
};

export default nextConfig;
