-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext.config.js
More file actions
27 lines (24 loc) 路 792 Bytes
/
Copy pathnext.config.js
File metadata and controls
27 lines (24 loc) 路 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/** @type {import('next').NextConfig} */
const fs = require('fs');
const path = require('path');
// Try to read the last-updated file, fallback to current date if it doesn't exist
let lastUpdatedAt = new Date().toISOString().split('T')[0]; // YYYY-MM-DD format
try {
const lastUpdatedPath = path.join(process.cwd(), '.last-updated');
if (fs.existsSync(lastUpdatedPath)) {
lastUpdatedAt = fs.readFileSync(lastUpdatedPath, 'utf8');
}
} catch (error) {
console.warn('Could not read .last-updated file, using current date');
}
const nextConfig = {
reactStrictMode: true,
env: {
NEXT_PUBLIC_LAST_UPDATED_AT: lastUpdatedAt,
},
// Enable static generation
experimental: {
optimizePackageImports: ['@radix-ui/react-dropdown-menu'],
},
}
module.exports = nextConfig