- Installed @next/bundle-analyzer for bundle size analysis - Configured Next.js to optionally run bundle analysis with ANALYZE=true - Note: Bundle analyzer not yet compatible with Turbopack builds - Manual analysis shows well-optimized bundle: * Largest chunks: 114K (React/core), 110K (store/state) * CSS bundle: 34K * Most chunks under 30K thanks to code splitting * Total static chunks: 864K - Code splitting already implemented for all tools - Lazy loading active for optimal performance 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
28 lines
650 B
TypeScript
28 lines
650 B
TypeScript
import type { NextConfig } from 'next';
|
|
import bundleAnalyzer from '@next/bundle-analyzer';
|
|
|
|
const withBundleAnalyzer = bundleAnalyzer({
|
|
enabled: process.env.ANALYZE === 'true',
|
|
});
|
|
|
|
const nextConfig: NextConfig = {
|
|
output: 'export',
|
|
reactStrictMode: true,
|
|
// Turbopack configuration (Next.js 16+)
|
|
turbopack: {},
|
|
// Webpack fallback for older Next.js versions
|
|
webpack: (config) => {
|
|
// Required for Canvas API and Web Workers
|
|
config.resolve.fallback = {
|
|
...config.resolve.fallback,
|
|
fs: false,
|
|
path: false,
|
|
crypto: false,
|
|
};
|
|
|
|
return config;
|
|
},
|
|
};
|
|
|
|
export default withBundleAnalyzer(nextConfig);
|