vite-plugin-require
JSON →A Vite plugin that enables CommonJS require() syntax in Vite projects, converting require calls to ESM imports or import.meta.url references. Version 1.2.17 is the latest stable release, supporting Vite 2 through 6. It uses a regex-based transform to replace require() calls, with options to control file scope and conversion mode. Different from alternatives like @originjs/vite-plugin-commonjs, this plugin focuses specifically on require() transforms for asset and module references. It ships TypeScript types but has a limited API surface. Last updated in 2024, the plugin has moderate community adoption and is maintained for compatibility with newer Vite versions.
Traffic · last 30 days stale · no recent hits
total hits 17
actors 5 distinct systems
last hit 25d ago AhrefsBot
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇫🇷 France · VN · 🇮🇹 Italy
Resources
API endpoints
full doc /v1/registry/vite-plugin-require
compatibility /v1/registry/vite-plugin-require/compatibility