the-tip-top-frontend/next.config.js
soufiane 5d5375ff6b fix: force fresh builds to prevent cache issues between localhost and deployed site
- Add --no-cache flag to Docker build to force complete rebuild
- Clean .next and node_modules cache before each build
- Generate unique build ID with timestamp for each deployment
- Configure onDemandEntries to reduce cache duration

This ensures deployed site always matches localhost by preventing:
- Docker layer caching
- Next.js build cache
- Browser cache of stale assets

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 03:09:51 +01:00

32 lines
869 B
JavaScript

/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
env: {
NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL,
},
// Ignore build errors for pages that require client-side only rendering
typescript: {
ignoreBuildErrors: false,
},
eslint: {
ignoreDuringBuilds: false,
},
// Skip static page generation errors for client-only pages
experimental: {
missingSuspenseWithCSRBailout: false,
},
// Generate error pages instead of failing build on prerender errors
staticPageGenerationTimeout: 120,
// Generate build ID with timestamp to avoid cache issues
generateBuildId: async () => {
return `build-${Date.now()}`;
},
// Disable cache for assets to ensure fresh content
onDemandEntries: {
maxInactiveAge: 25 * 1000,
pagesBufferLength: 2,
},
};
module.exports = nextConfig;