A zero-config plugin that enhances Vite configuration for React applications with production-grade optimizations. Current stable version 1.3.6. Integrates SWC for fast compilation (5-10x faster), automatic Fast Refresh (HMR), and built-in bundle analysis. Ships TypeScript types. Requires Vite v4, v5, or v6 and Node >=18. Differentiator: opinionated, minimal setup with automatic production defaults for React projects.
npm install vite-enhancer-configVerified import paths — ran on the pinned version, not inferred.
Adds SWC compilation and bundle analysis to an existing Vite React setup with typed options.
Use dynamic import or switch to ESM.
Replace `analyzerKey` with `apiKey` in configuration.
Remove any manual SWC plugin from plugins array when swc option is enabled.
Upgrade Node.js to v18 or later.
Set `analyzer` mode to `static` or disable in non-interactive environments.
Run `npm install vite-enhancer-config -D`.
Use `import { viteEnhancerConfig } from 'vite-enhancer-config'`.Add `"type":"module"` to package.json or rename file to .mjs.