Preparing for system design interviews?  Try bugzed.com →

vite-plugin-commonjs-externals

JSON →
library 0.1.4 ·javascript
verified Jun 18, 2026

Vite plugin that prevents bundling of specified ESM imports and replaces them with CommonJS require() calls at runtime. Version 0.1.4, stable with infrequent releases. Designed for Electron renderer processes and Node.js environments where CommonJS modules (like 'electron', 'fs', 'path') must be imported via require() rather than bundled. Key differentiator: handles named, default, and namespace imports correctly by generating interop code similar to Rollup's CJS output. Unlike @vitejs/plugin-commonjs which focuses on converting CJS to ESM, this plugin does the reverse — converting ESM imports into CJS requires for a list of externals. Supports regex patterns for dynamic package matching.

total hits 12
actors 5 distinct systems
last hit 25d ago AhrefsBot
GPTBot
4
ClaudeBot
3
Script
1

top countries 🇺🇸 United States · 🇨🇦 Canada · 🇩🇪 Germany · 🇬🇧 United Kingdom · 🇸🇪 Sweden