Files
biblical-guide.com/next.config.js
Andrei 4303e48fac Fix Next.js 15 compatibility and TypeScript errors
- Update API route handlers to use async params for Next.js 15 compatibility
- Fix MUI DataGrid deprecated props (pageSize -> initialState.pagination)
- Replace Material-UI Grid components with Box for better compatibility
- Fix admin authentication system with proper request parameters
- Update permission constants to match available AdminPermission enum values
- Add missing properties to Page interface for type safety
- Update .gitignore to exclude venv/, import logs, and large data directories
- Optimize Next.js config to reduce memory usage during builds

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 09:54:13 +00:00

81 lines
1.9 KiB
JavaScript

const withNextIntl = require('next-intl/plugin')('./i18n.ts');
/** @type {import('next').NextConfig} */
const nextConfig = {
typedRoutes: false,
trailingSlash: false,
poweredByHeader: false,
compress: true,
// Build optimizations
experimental: {
// Disable webpack build worker to prevent memory issues
webpackBuildWorker: false,
},
// Webpack optimizations
webpack: (config, { dev, isServer }) => {
if (!dev) {
// Production optimizations
config.optimization = {
...config.optimization,
// Limit concurrent chunks to reduce memory usage
splitChunks: {
...config.optimization.splitChunks,
maxAsyncRequests: 6,
maxInitialRequests: 4,
},
}
}
// Exclude large directories from webpack processing
config.watchOptions = {
...config.watchOptions,
ignored: [
'**/node_modules/**',
'**/bibles/**',
'**/scripts/**',
'**/.git/**',
'**/.next/**'
]
}
// Add ignore patterns for webpack - exclude entire directories
config.module.rules.push({
test: /[\\/](bibles|scripts)[\\/]/,
use: 'ignore-loader'
})
// Also exclude these paths from resolve
config.resolve = {
...config.resolve,
alias: {
...config.resolve?.alias,
// Prevent webpack from trying to resolve these directories
'@/bibles': false,
'@/scripts': false
}
}
// Reduce bundle analysis overhead
config.stats = 'errors-warnings'
return config
},
// Reduce build memory usage
onDemandEntries: {
maxInactiveAge: 25 * 1000,
pagesBufferLength: 2,
},
// Exclude large static files from processing
pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'md'],
// Ignore large directories during builds
async rewrites() {
return []
},
}
module.exports = withNextIntl(nextConfig)