mirror of
https://github.com/bitbaum/orangecat.git
synced 2026-12-04 21:27:45 +01:00
- Bump version to 0.1.1 for tracking - Add webpack-bundle-optimizer script for Next.js config - Simplify ESLint configuration to resolve missing dependencies - Prepare for production deployment with proper version control This deployment includes: - Profile update fixes with banner_url support - LN address validation - Auth cookie fixes for profile updates - Various documentation and testing improvements 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
50 lines
1.1 KiB
JavaScript
50 lines
1.1 KiB
JavaScript
/**
|
|
* Webpack Bundle Optimizer
|
|
* Provides configuration optimizations for Next.js webpack builds
|
|
*/
|
|
|
|
function getOptimizedWebpackConfig(config, options) {
|
|
const { dev, isServer } = options;
|
|
|
|
// Only apply optimizations in production
|
|
if (dev) {
|
|
return config;
|
|
}
|
|
|
|
// Enhanced optimization for production builds
|
|
config.optimization = {
|
|
...config.optimization,
|
|
minimize: true,
|
|
// Split chunks for better caching
|
|
splitChunks: {
|
|
...config.optimization.splitChunks,
|
|
chunks: 'all',
|
|
cacheGroups: {
|
|
default: false,
|
|
vendors: false,
|
|
// Vendor chunk for common libraries
|
|
lib: {
|
|
name: 'lib',
|
|
test: /[\\/]node_modules[\\/]/,
|
|
priority: 10,
|
|
minChunks: 1,
|
|
reuseExistingChunk: true,
|
|
},
|
|
// Common chunks used across pages
|
|
commons: {
|
|
name: 'commons',
|
|
minChunks: 2,
|
|
priority: 5,
|
|
reuseExistingChunk: true,
|
|
},
|
|
},
|
|
},
|
|
};
|
|
|
|
return config;
|
|
}
|
|
|
|
module.exports = {
|
|
getOptimizedWebpackConfig,
|
|
};
|