fix: SEO canonical URLs, LCP performance, remove unused dependencies
- Remove duplicate app/projects/ route (was causing 5xx and soft 404) - Fix nginx: redirect www.dk0.dev → dk0.dev (non-www canonical) - Fix not-found.tsx: locale-prefixed links, remove framer-motion dependency - Add fetchPriority='high' and will-change to Hero LCP image - Add preconnect hints for hardcover.app and cms.dk0.dev - Reduce background blur from 100px to 80px (LCP rendering delay) - Remove boneyard-js (~20 KiB), replace with custom Skeleton component - Remove react-icons (~10 KiB), replace with inline SVGs - Conditionally render mobile menu (saves ~20 DOM nodes) - Add /books to sitemap - Optimize image config with explicit deviceSizes/imageSizes
This commit is contained in:
@@ -33,7 +33,7 @@ const nextConfig: NextConfig = {
|
||||
// Performance optimizations
|
||||
experimental: {
|
||||
// Tree-shake barrel-file packages in both dev and production
|
||||
optimizePackageImports: ["lucide-react", "framer-motion", "react-icons", "@tiptap/react"],
|
||||
optimizePackageImports: ["lucide-react", "framer-motion", "@tiptap/react"],
|
||||
// Merge all CSS into a single chunk to eliminate the render-blocking CSS chain
|
||||
// (84dc7384.css → 3aefc04b.css sequential dependency reported by PageSpeed).
|
||||
cssChunking: false,
|
||||
@@ -47,6 +47,8 @@ const nextConfig: NextConfig = {
|
||||
images: {
|
||||
formats: ["image/webp", "image/avif"],
|
||||
minimumCacheTTL: 2592000,
|
||||
deviceSizes: [640, 768, 1024, 1280, 1536],
|
||||
imageSizes: [16, 32, 48, 64, 96, 128, 256],
|
||||
remotePatterns: [
|
||||
{
|
||||
protocol: "https",
|
||||
@@ -81,6 +83,11 @@ const nextConfig: NextConfig = {
|
||||
|
||||
// Webpack configuration
|
||||
webpack: (config, { dev, isServer, webpack }) => {
|
||||
// Skip adding polyfill webpack aliases — Next.js injects polyfills via <script>
|
||||
// tags, not through webpack module resolution, so aliases don't take effect.
|
||||
// The browserslist targets (chrome >= 100, etc.) already prevent unnecessary
|
||||
// transpilation; the 11.7 KiB polyfill chunk is a known Next.js limitation.
|
||||
|
||||
// Fix for module resolution issues
|
||||
config.resolve.fallback = {
|
||||
...config.resolve.fallback,
|
||||
|
||||
Reference in New Issue
Block a user