84 lines
2.1 KiB
JavaScript
84 lines
2.1 KiB
JavaScript
import nextMDX from "@next/mdx";
|
|
import path from "path";
|
|
|
|
/** @type {import('next').NextConfig} */
|
|
const nextConfig = {
|
|
// Turbopack disabled by default for production builds to avoid the 'Killed' error (OOM)
|
|
// which often happens with Turbopack in resource-constrained environments.
|
|
|
|
experimental: {
|
|
optimizePackageImports: [
|
|
'lucide-react',
|
|
'react-icons',
|
|
'@tabler/icons-react',
|
|
'framer-motion',
|
|
'react-hook-form',
|
|
'@radix-ui/react-label',
|
|
'@radix-ui/react-slot',
|
|
],
|
|
},
|
|
|
|
reactStrictMode: false,
|
|
|
|
images: {
|
|
remotePatterns: [
|
|
{ protocol: 'https', hostname: 'i.pravatar.cc' },
|
|
{ protocol: 'https', hostname: 'images.unsplash.com' },
|
|
{ protocol: 'https', hostname: '*.supabase.co' },
|
|
{ protocol: 'https', hostname: 'www.robot-speed.com' },
|
|
{ protocol: 'https', hostname: 'robot-speed.com' },
|
|
],
|
|
formats: ['image/avif', 'image/webp'],
|
|
loader: 'default',
|
|
dangerouslyAllowSVG: true,
|
|
contentSecurityPolicy: "default-src 'self'; script-src 'none'; sandbox;",
|
|
},
|
|
|
|
pageExtensions: ["js", "jsx", "ts", "tsx", "mdx"],
|
|
poweredByHeader: false,
|
|
compress: true,
|
|
|
|
typescript: {
|
|
ignoreBuildErrors: true // Bypass type errors for speed during troubleshooting
|
|
},
|
|
|
|
eslint: {
|
|
ignoreDuringBuilds: true // Bypass lint errors
|
|
},
|
|
|
|
compiler: {
|
|
removeConsole: process.env.NODE_ENV === 'production',
|
|
},
|
|
|
|
transpilePackages: ['geist', 'cobe'],
|
|
|
|
webpack: (config, { isServer, webpack }) => {
|
|
config.resolve.alias = {
|
|
...config.resolve.alias,
|
|
'@': path.resolve('.'),
|
|
};
|
|
|
|
const isProduction = process.env.NODE_ENV === 'production' || process.env.VERCEL === '1';
|
|
|
|
if (isProduction) {
|
|
config.plugins.push(
|
|
new webpack.NormalModuleReplacementPlugin(
|
|
/tailwind-cdn-loader/,
|
|
path.resolve('./components/empty-loader.tsx')
|
|
)
|
|
);
|
|
}
|
|
|
|
return config;
|
|
},
|
|
};
|
|
|
|
const withMDX = nextMDX({
|
|
extension: /\.mdx?$/,
|
|
options: {
|
|
providerImportSource: '@mdx-js/react',
|
|
},
|
|
});
|
|
|
|
export default withMDX(nextConfig);
|