/** @type {import('next').NextConfig} */ import bundleAnalyzer from "@next/bundle-analyzer" const withBundleAnalyzer = bundleAnalyzer({ enabled: process.env.ANALYZE === "true", }) const legacyRedirects = [ { source: "/about", destination: "/about-us", permanent: true, }, { source: "/services/service-areas", destination: "/service-areas", permanent: true, }, { source: "/business", destination: "/vending-machines", permanent: true, }, { source: "/vending-machine-repairs", destination: "/services/repairs", permanent: true, }, { source: "/vending-machines/parts-and-support", destination: "/services/parts", permanent: true, }, { source: "/healthy-vending", destination: "/food-and-beverage/healthy-options", permanent: true, }, { source: "/traditional-vending", destination: "/food-and-beverage/traditional-options", permanent: true, }, { source: "/diverse-vending-options-with-rocky-mountain-vendings-exclusive-wholesale-accounts", destination: "/food-and-beverage/suppliers", permanent: true, }, { source: "/faqs", destination: "/about/faqs", permanent: true, }, { source: "/terms-conditions", destination: "/terms-and-conditions", permanent: true, }, { source: "/streamlining-snack-and-beverage-access-in-warehouse-environments", destination: "/warehouses", permanent: true, }, { source: "/enhancing-auto-repair-facilities-with-convenient-vending-solutions", destination: "/auto-repair", permanent: true, }, { source: "/business/vending-machine-for-your-gym", destination: "/gyms", permanent: true, }, { source: "/business/vending-for-your-community-centers", destination: "/community-centers", permanent: true, }, { source: "/business/vending-machine-for-your-dance-studio", destination: "/dance-studios", permanent: true, }, { source: "/vending-machines-for-your-car-wash", destination: "/car-washes", permanent: true, }, { source: "/ogden-utah", destination: "/vending-machines-ogden-utah", permanent: true, }, { source: "/best-vending-machine-supplier-bountiful-utah", destination: "/vending-machines-bountiful-utah", permanent: true, }, { source: "/best-vending-machine-supplier-in-orem-utah", destination: "/vending-machines-orem-utah", permanent: true, }, { source: "/best-vending-machine-supplier-in-salt-lake-city-utah", destination: "/blog/best-vending-machine-supplier-in-salt-lake-city-utah", permanent: true, }, ] const nextConfig = { // Enable standalone output for Docker output: "standalone", typescript: { ignoreBuildErrors: true, }, // Optimize package imports for better bundle size and faster builds // This transforms barrel imports to direct imports at build time // See: https://vercel.com/blog/how-we-optimized-package-imports-in-next-js experimental: { optimizePackageImports: [ "lucide-react", "@radix-ui/react-slot", "@radix-ui/react-dialog", "@radix-ui/react-dropdown-menu", "@radix-ui/react-navigation-menu", "@radix-ui/react-tooltip", "@radix-ui/react-popover", "@radix-ui/react-select", "@radix-ui/react-tabs", "@radix-ui/react-accordion", "@radix-ui/react-alert-dialog", "@radix-ui/react-avatar", "@radix-ui/react-checkbox", "@radix-ui/react-collapsible", "@radix-ui/react-context-menu", "@radix-ui/react-hover-card", "@radix-ui/react-label", "@radix-ui/react-menubar", "@radix-ui/react-progress", "@radix-ui/react-radio-group", "@radix-ui/react-scroll-area", "@radix-ui/react-separator", "@radix-ui/react-slider", "@radix-ui/react-switch", "@radix-ui/react-toggle", "@radix-ui/react-toggle-group", "@radix-ui/react-toast", "recharts", ], }, // Temporarily disable Turbopack to fix MIME type issues // Set turbopack root to silence workspace detection warning // This tells Next.js to use the current directory (code/) as the root // turbopack: { // root: process.cwd(), // }, images: { // Image optimization disabled for static export (GHL hosting) // Static export doesn't support Next.js Image optimization unoptimized: true, remotePatterns: [ { protocol: "https", hostname: "rockymountainvending.com", pathname: "/wp-content/uploads/**", }, { protocol: "https", hostname: "www.rockymountainvending.com", pathname: "/wp-content/uploads/**", }, ], // Image optimization settings formats: ["image/webp", "image/avif"], deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840], imageSizes: [16, 32, 48, 64, 96, 128, 256, 384], // Performance optimizations minimumCacheTTL: 60, dangerouslyAllowSVG: false, contentSecurityPolicy: "default-src 'self'; script-src 'none'; sandbox;", }, async redirects() { return legacyRedirects }, } export default withBundleAnalyzer(nextConfig)