vite-plugin-cjs-interop
JSON →A Vite plugin that unwraps default imports from CommonJS (CJS) dependencies during SSR, solving the issue where CJS modules with both default and named exports require accessing the default via .default in ESM. Version 3.3.0 is current, with recent releases every few months. It works around Vite's SSR hoisting bug (vite#22122) and supports Vite 6.4–8. Automatically transforms import statements so that default imports work seamlessly in SSR, and handles dynamic imports to allow both ESM namespace and CJS direct property access. Competes with vite-plugin-commonjs but focuses specifically on default interop during SSR. ESM-only since v3 headless.
Traffic · last 30 days ↓83% vs prev 7d
total hits 15
actors 4 distinct systems
last hit 6d ago human
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇬🇧 United Kingdom
Resources
API endpoints
full doc /v1/registry/vite-plugin-cjs-interop