vite-plugin-treat-umd-as-commonjs

JSON →
library 0.1.4 ·javascript
verified Apr 27, 2026

Vite plugin that resolves edge cases when using RequireJS/AMD in the browser by injecting `var define = false;` into UMD modules, preventing RequireJS from hijacking them. This addresses a specific issue where Vite's UMD-to-CommonJS conversion breaks in a browser RequireJS environment (vitejs/vite#5900). Current version 0.1.4, ships TypeScript types, requires Vite as peer dependency. Use this when you need to serve UMD modules via Vite but the page also includes RequireJS (e.g., legacy dependencies). The plugin is lightweight and scoped to this single concern.

total hits 10
actors 3 distinct systems
last hit 6d ago human
GPTBot
5
Search engines
1
Humans
2

top countries 🇺🇸 United States · 🇨🇦 Canada