{"library":"vite-plugin-commonjs-externals","type":"library","category":null,"description":"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.","language":"javascript","status":"active","version":"0.1.4","tags":["javascript","vite-plugin","commonjs"],"last_verified":"Mon Apr 27","install":[{"cmd":"npm install vite-plugin-commonjs-externals","imports":["import commonjsExternals from 'vite-plugin-commonjs-externals'","import commonjsExternals from 'vite-plugin-commonjs-externals'","import { presets } from 'vite-plugin-commonjs-externals'"]},{"cmd":"yarn add vite-plugin-commonjs-externals","imports":[]},{"cmd":"pnpm add vite-plugin-commonjs-externals","imports":[]}],"homepage":null,"github":"https://github.com/xiaoxiangmoe/vite-plugin-commonjs-externals","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/vite-plugin-commonjs-externals","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":null}