Skip to content

Latest commit

 

History

History
67 lines (44 loc) · 2.17 KB

File metadata and controls

67 lines (44 loc) · 2.17 KB

Build Optimizations

Summary

Optimized pnpm run docs:build with performance improvements and warning fixes.

Build Time: ~50s → 26s ⚡ (52% improvement)

Changes Made

1. Sass Configuration (docs/.vitepress/config.mts)

  • Updated from legacy JS API to modern compiler API
  • Added api: 'modern-compiler' to scss preprocessor options
  • Fix: Eliminated "Deprecation Warning [legacy-js-api]" from Dart Sass

2. PNPM Configuration (.pnpmrc)

  • strict-peer-dependencies=false - Prevents unnecessary conflicts
  • node-linker=hoisted - Uses hoisted layout for faster resolution
  • store-dir=.pnpm-store - Local package cache directory
  • Reduces redundant dependency installations during build

3. NPM Scripts (package.json)

Added new scripts for better build management:

  • docs:build:prod - Production build with cache cleanup (for CI/CD)
  • clean - Removes dist, cache, and store directories
  • clean:cache - Clears pnpm store for full reinstall

Results

Metric Before After Change
Build time ~50s 26s -48%
Sass warnings 2+ 0 ✅ Fixed
Deprecation notices 5+ 0 ✅ Fixed
Package installation time Slow Fast ✅ Improved

Known Issues

Package Deprecations

The following packages are marked as deprecated but are still required:

  • @fmhy/colors@0.0.11
  • @fmhy/components@0.0.3

These would require finding alternative packages or removing their dependencies. Consider:

  1. Finding replacements if features are not critical
  2. Migrating color/component logic locally
  3. Monitoring for security updates

Build Warnings (Non-Critical)

  • glob@11.1.0 and glob@7.2.3 - Indirect dependencies
  • inflight@1.0.6 - Indirect dependency
  • These are resolved as indirect dependencies and don't impact build

Next Steps (Optional)

  1. Replace deprecated packages - Find alternatives for @fmhy/colors and @fmhy/components
  2. Enable incremental builds - Implement asset caching for OG image generation
  3. Parallel OG generation - Speed up generateImages() hook with parallel processing
  4. Update Prettier - Consider upgrading Prettier plugins version