Background
Back to Insights
engineering

222

A
Admin User
Senior Engineer
3/7/2026
import fs from 'fs';
import path from 'path';

const filesToFix = [
    'src/app/(marketing)/specialty-manufacturing/[slug]/page.tsx',
    'src/app/(marketing)/specialty-manufacturing/page.tsx',
    'src/app/(marketing)/solutions/[slug]/page.tsx',
    'src/app/(marketing)/solutions/page.tsx',
    'src/app/(marketing)/insights/page.tsx',
    'src/app/(marketing)/industries/[slug]/page.tsx',
    'src/app/(marketing)/industries/page.tsx',
    'src/app/(marketing)/case-studies/[slug]/page.tsx',
];

filesToFix.forEach(relPath => { const fullPath = path.join(process.cwd(), relPath); if (fs.existsSync(fullPath)) { let content = fs.readFileSync(fullPath, 'utf8'); // Replace force-dynamic and revalidate = 0 content = content.replace(/export const dynamic = ['"]force-dynamic['"];?( \/\/.*)?\n/g, ''); content = content.replace(/export const revalidate = 0;\n/g, 'export const revalidate = 60;\n');

// Fallback if revalidate wasn't there if (!content.includes('export const revalidate')) { content = content.replace(/(import .*?\n\n)/, '$1export const revalidate = 60;\n\n'); } fs.writeFileSync(fullPath, content); console.log(`Fixed ${relPath}`); } });

Share this insight

Facing a similar challenge?

Our engineering team can perform a free DFM analysis for your engineering project.

Talk to an Engineer

About the Author

A
Admin User
Chief Engineer @ TWI

Specializing in complex 2K molds and high-precision components with 15+ years of experience in the automotive sector.